Changeset View
Changeset View
Standalone View
Standalone View
contrib/gdb/gdb/arm-tdep.c
Show First 20 Lines • Show All 1,986 Lines • ▼ Show 20 Lines | |||||
arm_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) | arm_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) | ||||
{ | { | ||||
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); | struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); | ||||
if (arm_pc_is_thumb (*pcptr)) | if (arm_pc_is_thumb (*pcptr)) | ||||
{ | { | ||||
*pcptr = UNMAKE_THUMB_ADDR (*pcptr); | *pcptr = UNMAKE_THUMB_ADDR (*pcptr); | ||||
*lenptr = tdep->thumb_breakpoint_size; | *lenptr = tdep->thumb_breakpoint_size; | ||||
return tdep->thumb_breakpoint; | return (const unsigned char *)tdep->thumb_breakpoint; | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
*lenptr = tdep->arm_breakpoint_size; | *lenptr = tdep->arm_breakpoint_size; | ||||
return tdep->arm_breakpoint; | return (const unsigned char *)tdep->arm_breakpoint; | ||||
} | } | ||||
} | } | ||||
/* Extract from an array REGBUF containing the (raw) register state a | /* Extract from an array REGBUF containing the (raw) register state a | ||||
function return value of type TYPE, and copy that, in virtual | function return value of type TYPE, and copy that, in virtual | ||||
format, into VALBUF. */ | format, into VALBUF. */ | ||||
static void | static void | ||||
▲ Show 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | else if (TYPE_CODE (type) == TYPE_CODE_INT | ||||
|| TYPE_CODE (type) == TYPE_CODE_REF | || TYPE_CODE (type) == TYPE_CODE_REF | ||||
|| TYPE_CODE (type) == TYPE_CODE_ENUM) | || TYPE_CODE (type) == TYPE_CODE_ENUM) | ||||
{ | { | ||||
if (TYPE_LENGTH (type) <= 4) | if (TYPE_LENGTH (type) <= 4) | ||||
{ | { | ||||
/* Values of one word or less are zero/sign-extended and | /* Values of one word or less are zero/sign-extended and | ||||
returned in r0. */ | returned in r0. */ | ||||
bfd_byte tmpbuf[INT_REGISTER_SIZE]; | bfd_byte tmpbuf[INT_REGISTER_SIZE]; | ||||
LONGEST val = unpack_long (type, valbuf); | LONGEST val = unpack_long (type, (const char *)valbuf); | ||||
store_signed_integer (tmpbuf, INT_REGISTER_SIZE, val); | store_signed_integer (tmpbuf, INT_REGISTER_SIZE, val); | ||||
regcache_cooked_write (regs, ARM_A1_REGNUM, tmpbuf); | regcache_cooked_write (regs, ARM_A1_REGNUM, tmpbuf); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
/* Integral values greater than one word are stored in consecutive | /* Integral values greater than one word are stored in consecutive | ||||
registers starting with r0. This will always be a multiple of | registers starting with r0. This will always be a multiple of | ||||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
set_disassembly_style (void) | set_disassembly_style (void) | ||||
{ | { | ||||
const char *setname, *setdesc, **regnames; | const char *setname, *setdesc, **regnames; | ||||
int numregs, j; | int numregs, j; | ||||
/* Find the style that the user wants in the opcodes table. */ | /* Find the style that the user wants in the opcodes table. */ | ||||
int current = 0; | int current = 0; | ||||
numregs = get_arm_regnames (current, &setname, &setdesc, ®names); | numregs = get_arm_regnames (current, &setname, &setdesc, (const char *const **)®names); | ||||
while ((disassembly_style != setname) | while ((disassembly_style != setname) | ||||
&& (current < num_disassembly_options)) | && (current < num_disassembly_options)) | ||||
get_arm_regnames (++current, &setname, &setdesc, ®names); | get_arm_regnames (++current, &setname, &setdesc, (const char *const **)®names); | ||||
current_option = current; | current_option = current; | ||||
/* Fill our copy. */ | /* Fill our copy. */ | ||||
for (j = 0; j < numregs; j++) | for (j = 0; j < numregs; j++) | ||||
arm_register_names[j] = (char *) regnames[j]; | arm_register_names[j] = (char *) regnames[j]; | ||||
/* Adjust case. */ | /* Adjust case. */ | ||||
if (isupper (*regnames[ARM_PC_REGNUM])) | if (isupper (*regnames[ARM_PC_REGNUM])) | ||||
▲ Show 20 Lines • Show All 436 Lines • ▼ Show 20 Lines | _initialize_arm_tdep (void) | ||||
fprintf_unfiltered (stb, "Set the disassembly style.\n" | fprintf_unfiltered (stb, "Set the disassembly style.\n" | ||||
"The valid values are:\n"); | "The valid values are:\n"); | ||||
/* Initialize the array that will be passed to add_set_enum_cmd(). */ | /* Initialize the array that will be passed to add_set_enum_cmd(). */ | ||||
valid_disassembly_styles | valid_disassembly_styles | ||||
= xmalloc ((num_disassembly_options + 1) * sizeof (char *)); | = xmalloc ((num_disassembly_options + 1) * sizeof (char *)); | ||||
for (i = 0; i < num_disassembly_options; i++) | for (i = 0; i < num_disassembly_options; i++) | ||||
{ | { | ||||
numregs = get_arm_regnames (i, &setname, &setdesc, ®names); | numregs = get_arm_regnames (i, &setname, &setdesc, (const char *const **)®names); | ||||
valid_disassembly_styles[i] = setname; | valid_disassembly_styles[i] = setname; | ||||
fprintf_unfiltered (stb, "%s - %s\n", setname, | fprintf_unfiltered (stb, "%s - %s\n", setname, | ||||
setdesc); | setdesc); | ||||
/* Copy the default names (if found) and synchronize disassembler. */ | /* Copy the default names (if found) and synchronize disassembler. */ | ||||
if (!strcmp (setname, "std")) | if (!strcmp (setname, "std")) | ||||
{ | { | ||||
disassembly_style = setname; | disassembly_style = setname; | ||||
current_option = i; | current_option = i; | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |