* defs.h (extract_address): Delete declaration.
* findvar.c (extract_address): Delete function.
* xstormy16-tdep.c (xstormy16_extract_return_value): Replace
extract_address with the inline equivalent,
extract_unsigned_integer.
(xstormy16_extract_struct_value_address): Ditto.
(xstormy16_pointer_to_address): Ditto.
* vax-tdep.c (vax_extract_struct_value_address): Ditto.
* v850-tdep.c (v850_push_arguments): Ditto.
(v850_extract_return_value): Ditto.
(v850_extract_struct_value_address): Ditto.
* sparcnbsd-tdep.c (sparcnbsd_get_longjmp_target_32): Ditto.
(sparcnbsd_get_longjmp_target_64): Ditto.
* sparc-tdep.c (sparc_frame_saved_pc): Ditto.
(get_longjmp_target): Ditto.
* sh-tdep.c (sh_extract_struct_value_address): Ditto.
(sh64_extract_struct_value_address): Ditto.
(sh_push_arguments): Ditto.
(sh64_push_arguments): Ditto.
* remote-vxsparc.c (vx_read_register): Ditto.
* ppc-linux-tdep.c (ppc_linux_skip_trampoline_code): Ditto.
* ns32k-tdep.c (ns32k_extract_struct_value_address): Ditto.
* mn10300-tdep.c (mn10300_extract_struct_value_address): Ditto.
* mipsv4-nat.c (get_longjmp_target): Ditto.
* mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Ditto.
* mips-nat.c (get_longjmp_target): Ditto.
* mips-linux-tdep.c (mips_linux_get_longjmp_target): Ditto.
* mcore-tdep.c (mcore_extract_struct_value_address): Ditto.
* m68k-tdep.c (m68k_get_longjmp_target): Ditto.
* m68hc11-tdep.c (m68hc11_extract_struct_value_address): Ditto.
* irix5-nat.c (get_longjmp_target): Ditto.
* irix4-nat.c (get_longjmp_target): Ditto.
* ia64-tdep.c (generic_elf_find_global_pointer): Ditto.
(ia64_push_arguments): Ditto.
* hpux-thread.c (hpux_thread_store_registers): Ditto.
* h8300-tdep.c (h8300_push_arguments): Ditto.
(h8300_store_return_value): Ditto.
(h8300_extract_struct_value_address): Ditto.
* frv-tdep.c (frv_extract_struct_value_address): Ditto.
(frv_push_arguments): Ditto.
* avr-tdep.c (avr_pointer_to_address): Ditto.
(avr_push_arguments): Ditto.
* arm-tdep.c (arm_push_dummy_call): Ditto.
(arm_get_longjmp_target): Ditto.
* arm-linux-tdep.c (arm_linux_push_arguments): Ditto.
* alpha-tdep.c (alpha_extract_struct_value_address): Ditto.
(alpha_get_longjmp_target): Ditto.
2003-06-01 Andrew Cagney <cagney@redhat.com>
+ * defs.h (extract_address): Delete declaration.
+ * findvar.c (extract_address): Delete function.
+ * xstormy16-tdep.c (xstormy16_extract_return_value): Replace
+ extract_address with the inline equivalent,
+ extract_unsigned_integer.
+ (xstormy16_extract_struct_value_address): Ditto.
+ (xstormy16_pointer_to_address): Ditto.
+ * vax-tdep.c (vax_extract_struct_value_address): Ditto.
+ * v850-tdep.c (v850_push_arguments): Ditto.
+ (v850_extract_return_value): Ditto.
+ (v850_extract_struct_value_address): Ditto.
+ * sparcnbsd-tdep.c (sparcnbsd_get_longjmp_target_32): Ditto.
+ (sparcnbsd_get_longjmp_target_64): Ditto.
+ * sparc-tdep.c (sparc_frame_saved_pc): Ditto.
+ (get_longjmp_target): Ditto.
+ * sh-tdep.c (sh_extract_struct_value_address): Ditto.
+ (sh64_extract_struct_value_address): Ditto.
+ (sh_push_arguments): Ditto.
+ (sh64_push_arguments): Ditto.
+ * remote-vxsparc.c (vx_read_register): Ditto.
+ * ppc-linux-tdep.c (ppc_linux_skip_trampoline_code): Ditto.
+ * ns32k-tdep.c (ns32k_extract_struct_value_address): Ditto.
+ * mn10300-tdep.c (mn10300_extract_struct_value_address): Ditto.
+ * mipsv4-nat.c (get_longjmp_target): Ditto.
+ * mipsnbsd-tdep.c (mipsnbsd_get_longjmp_target): Ditto.
+ * mips-nat.c (get_longjmp_target): Ditto.
+ * mips-linux-tdep.c (mips_linux_get_longjmp_target): Ditto.
+ * mcore-tdep.c (mcore_extract_struct_value_address): Ditto.
+ * m68k-tdep.c (m68k_get_longjmp_target): Ditto.
+ * m68hc11-tdep.c (m68hc11_extract_struct_value_address): Ditto.
+ * irix5-nat.c (get_longjmp_target): Ditto.
+ * irix4-nat.c (get_longjmp_target): Ditto.
+ * ia64-tdep.c (generic_elf_find_global_pointer): Ditto.
+ (ia64_push_arguments): Ditto.
+ * hpux-thread.c (hpux_thread_store_registers): Ditto.
+ * h8300-tdep.c (h8300_push_arguments): Ditto.
+ (h8300_store_return_value): Ditto.
+ (h8300_extract_struct_value_address): Ditto.
+ * frv-tdep.c (frv_extract_struct_value_address): Ditto.
+ (frv_push_arguments): Ditto.
+ * avr-tdep.c (avr_pointer_to_address): Ditto.
+ (avr_push_arguments): Ditto.
+ * arm-tdep.c (arm_push_dummy_call): Ditto.
+ (arm_get_longjmp_target): Ditto.
+ * arm-linux-tdep.c (arm_linux_push_arguments): Ditto.
+ * alpha-tdep.c (alpha_extract_struct_value_address): Ditto.
+ (alpha_get_longjmp_target): Ditto.
+
* solib-irix.c (extract_mips_address): Inline extract_address,
replacing it with extract_signed_integer.
* solib-svr4.c (SOLIB_EXTRACT_ADDRESS): Ditto.
static CORE_ADDR
alpha_extract_struct_value_address (char *regbuf)
{
- return (extract_address (regbuf + REGISTER_BYTE (ALPHA_V0_REGNUM),
- REGISTER_RAW_SIZE (ALPHA_V0_REGNUM)));
+ return (extract_unsigned_integer (regbuf + REGISTER_BYTE (ALPHA_V0_REGNUM),
+ REGISTER_RAW_SIZE (ALPHA_V0_REGNUM)));
}
\f
raw_buffer, tdep->jb_elt_size))
return 0;
- *pc = extract_address (raw_buffer, tdep->jb_elt_size);
+ *pc = extract_unsigned_integer (raw_buffer, tdep->jb_elt_size);
return 1;
}
&& NULL != target_type
&& TYPE_CODE_FUNC == TYPE_CODE (target_type))
{
- CORE_ADDR regval = extract_address (val, len);
+ CORE_ADDR regval = extract_unsigned_integer (val, len);
if (arm_pc_is_thumb (regval))
store_unsigned_integer (val, len, MAKE_THUMB_ADDR (regval));
}
if (argreg <= ARM_LAST_ARG_REGNUM)
{
/* It's an argument being passed in a general register. */
- regval = extract_address (val, partial_len);
+ regval = extract_unsigned_integer (val, partial_len);
write_register (argreg++, regval);
}
else
&& target_type != NULL
&& TYPE_CODE_FUNC == TYPE_CODE (target_type))
{
- CORE_ADDR regval = extract_address (val, len);
+ CORE_ADDR regval = extract_unsigned_integer (val, len);
if (arm_pc_is_thumb (regval))
{
val = alloca (len);
{
/* The argument is being passed in a general purpose
register. */
- CORE_ADDR regval = extract_address (val, partial_len);
+ CORE_ADDR regval = extract_unsigned_integer (val, partial_len);
if (arm_debug)
fprintf_unfiltered (gdb_stdlog, "arg %d in %s = 0x%s\n",
argnum, REGISTER_NAME (argreg),
INT_REGISTER_RAW_SIZE))
return 0;
- *pc = extract_address (buf, INT_REGISTER_RAW_SIZE);
+ *pc = extract_unsigned_integer (buf, INT_REGISTER_RAW_SIZE);
return 1;
}
static CORE_ADDR
avr_pointer_to_address (struct type *type, const void *buf)
{
- CORE_ADDR addr = extract_address (buf, TYPE_LENGTH (type));
+ CORE_ADDR addr = extract_unsigned_integer (buf, TYPE_LENGTH (type));
if (TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type)))
{
while (len > 0)
{ /* there's room in registers */
len -= wordsize;
- regval = extract_address (val + len, wordsize);
+ regval = extract_unsigned_integer (val + len, wordsize);
write_register (argreg--, regval);
}
}
extern int extract_long_unsigned_integer (const void *, int, LONGEST *);
-extern CORE_ADDR extract_address (const void *, int);
-
extern CORE_ADDR extract_typed_address (const void *buf, struct type *type);
extern void store_signed_integer (void *, int, LONGEST);
}
-/* Treat the LEN bytes at ADDR as a target-format address, and return
- that address. ADDR is a buffer in the GDB process, not in the
- inferior.
-
- This function should only be used by target-specific code. It
- assumes that a pointer has the same representation as that thing's
- address represented as an integer. Some machines use word
- addresses, or similarly munged things, for certain types of
- pointers, so that assumption doesn't hold everywhere.
-
- Common code should use extract_typed_address instead, or something
- else based on POINTER_TO_ADDRESS. */
-
-CORE_ADDR
-extract_address (const void *addr, int len)
-{
- /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
- whether we want this to be true eventually. */
- return (CORE_ADDR) extract_unsigned_integer (addr, len);
-}
-
-
/* Treat the bytes at BUF as a pointer of type TYPE, and return the
address it represents. */
CORE_ADDR
static CORE_ADDR
frv_extract_struct_value_address (char *regbuf)
{
- return extract_address (regbuf + frv_register_byte (struct_return_regnum),
- 4);
+ return extract_unsigned_integer (regbuf + frv_register_byte (struct_return_regnum),
+ 4);
}
static void
if (argreg < 14)
{
- regval = extract_address (val, partial_len);
+ regval = extract_unsigned_integer (val, partial_len);
#if 0
printf(" Argnum %d data %x -> reg %d\n",
argnum, (int) regval, argreg);
for (offset = 0; offset < padded_len; offset += wordsize)
{
- ULONGEST word = extract_address (padded + offset, wordsize);
+ ULONGEST word = extract_unsigned_integer (padded + offset, wordsize);
write_register (reg++, word);
}
}
{
case 1: /* char */
case 2: /* short, int */
- regval = extract_address (valbuf, len);
+ regval = extract_unsigned_integer (valbuf, len);
write_register (0, regval);
break;
case 4: /* long, float */
- regval = extract_address (valbuf, len);
+ regval = extract_unsigned_integer (valbuf, len);
if (wordsize == 4)
{
write_register (0, regval);
static CORE_ADDR
h8300_extract_struct_value_address (char *regbuf)
{
- return extract_address (regbuf + h8300_register_byte (E_ARG0_REGNUM),
- h8300_register_raw_size (E_ARG0_REGNUM));
+ return extract_unsigned_integer (regbuf + h8300_register_byte (E_ARG0_REGNUM),
+ h8300_register_raw_size (E_ARG0_REGNUM));
}
const static unsigned char *
&deprecated_registers[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
tcb_ptr->static_ctx.sp = (cma__t_hppa_regs *)
- (extract_address (&deprecated_registers[REGISTER_BYTE (regno)],
- REGISTER_RAW_SIZE (regno)) + 160);
+ (extract_unsigned_integer (&deprecated_registers[REGISTER_BYTE (regno)],
+ REGISTER_RAW_SIZE (regno)) + 160);
}
else if (regno == PC_REGNUM)
write_memory (sp - 20,
status = target_read_memory (addr + 8, buf, sizeof (buf));
if (status != 0)
break;
- global_pointer = extract_address (buf, sizeof (buf));
+ global_pointer = extract_unsigned_integer (buf, sizeof (buf));
/* The payoff... */
return global_pointer;
char val_buf[8];
store_unsigned_integer (val_buf, 8,
- find_func_descr (extract_address (VALUE_CONTENTS (arg), 8),
+ find_func_descr (extract_unsigned_integer (VALUE_CONTENTS (arg), 8),
&funcdescaddr));
if (slotnum < rseslots)
write_memory (rse_address_add (bsp, slotnum), val_buf, 8);
TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
- *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
+ *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
return 1;
}
TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
- *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
+ *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
return 1;
}
static CORE_ADDR
m68hc11_extract_struct_value_address (char *regbuf)
{
- return extract_address (®buf[HARD_D_REGNUM * 2],
- REGISTER_RAW_SIZE (HARD_D_REGNUM));
+ return extract_unsigned_integer (®buf[HARD_D_REGNUM * 2],
+ REGISTER_RAW_SIZE (HARD_D_REGNUM));
}
/* Function: push_return_address (pc)
buf, TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
- jb_addr = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
+ jb_addr = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
if (target_read_memory (jb_addr + tdep->jb_pc * tdep->jb_elt_size, buf,
TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
- *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
+ *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
return 1;
}
CORE_ADDR
mcore_extract_struct_value_address (char *regbuf)
{
- return extract_address (regbuf + REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE);
+ return extract_unsigned_integer (regbuf + REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE);
}
/* Given a function which returns a value of type TYPE, extract the
buf, TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
- *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
+ *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
return 1;
}
buf, TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
- *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
+ *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
return 1;
}
TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
- *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
+ *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
return 1;
}
NBSD_MIPS_JB_ELEMENT_SIZE))
return 0;
- *pc = extract_address (buf, NBSD_MIPS_JB_ELEMENT_SIZE);
+ *pc = extract_unsigned_integer (buf, NBSD_MIPS_JB_ELEMENT_SIZE);
return 1;
}
TARGET_PTR_BIT / TARGET_CHAR_BIT))
return 0;
- *pc = extract_address (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
+ *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
return 1;
}
static CORE_ADDR
mn10300_extract_struct_value_address (char *regbuf)
{
- return extract_address (regbuf + REGISTER_BYTE (4),
- REGISTER_RAW_SIZE (4));
+ return extract_unsigned_integer (regbuf + REGISTER_BYTE (4),
+ REGISTER_RAW_SIZE (4));
}
static void
static CORE_ADDR
ns32k_extract_struct_value_address (char *regbuf)
{
- return (extract_address (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
+ return (extract_unsigned_integer (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
}
\f
void
/* Get address of the relocation entry (Elf32_Rela) */
if (target_read_memory (plt_table + reloc_index, buf, 4) != 0)
return 0;
- reloc = extract_address (buf, 4);
+ reloc = extract_unsigned_integer (buf, 4);
sect = find_pc_section (reloc);
if (!sect)
area in the frame. VxWorks does not do this for the active frame
automatically; it greatly simplifies debugging. */
- sp = extract_address (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)],
- REGISTER_RAW_SIZE (SP_REGNUM));
+ sp = extract_unsigned_integer (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)],
+ REGISTER_RAW_SIZE (SP_REGNUM));
write_memory (sp, &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
if (regno < 0 || (L0_REGNUM <= regno && regno <= I7_REGNUM))
{
- sp = extract_address (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)],
- REGISTER_RAW_SIZE (SP_REGNUM));
+ sp = extract_unsigned_integer (&deprecated_registers[REGISTER_BYTE (SP_REGNUM)],
+ REGISTER_RAW_SIZE (SP_REGNUM));
write_memory (sp, &deprecated_registers[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
}
static CORE_ADDR
sh_extract_struct_value_address (char *regbuf)
{
- return (extract_address ((regbuf), REGISTER_RAW_SIZE (0)));
+ return (extract_unsigned_integer ((regbuf), REGISTER_RAW_SIZE (0)));
}
static CORE_ADDR
sh64_extract_struct_value_address (char *regbuf)
{
- return (extract_address ((regbuf + REGISTER_BYTE (STRUCT_RETURN_REGNUM)),
- REGISTER_RAW_SIZE (STRUCT_RETURN_REGNUM)));
+ return (extract_unsigned_integer ((regbuf + REGISTER_BYTE (STRUCT_RETURN_REGNUM)),
+ REGISTER_RAW_SIZE (STRUCT_RETURN_REGNUM)));
}
static CORE_ADDR
if (argreg <= tdep->ARGLAST_REGNUM)
{
/* there's room in a register */
- regval = extract_address (val, REGISTER_RAW_SIZE (argreg));
+ regval = extract_unsigned_integer (val, REGISTER_RAW_SIZE (argreg));
write_register (argreg++, regval);
}
/* Store the value 4 bytes at a time. This means that things
if (int_argreg <= tdep->ARGLAST_REGNUM)
{
/* there's room in a register */
- regval = extract_address (val, argreg_size);
+ regval = extract_unsigned_integer (val, argreg_size);
write_register (int_argreg, regval);
}
/* Store the value 8 bytes at a time. This means that
stack layout has changed or the stack is corrupt. */
target_read_memory (sigcontext_addr + saved_pc_offset,
scbuf, sizeof (scbuf));
- return extract_address (scbuf, sizeof (scbuf));
+ return extract_unsigned_integer (scbuf, sizeof (scbuf));
}
else if (get_frame_extra_info (frame)->in_prologue ||
(get_next_frame (frame) != NULL &&
return PC_ADJUST (read_register (O7_REGNUM));
read_memory (addr, buf, SPARC_INTREG_SIZE);
- return PC_ADJUST (extract_address (buf, SPARC_INTREG_SIZE));
+ return PC_ADJUST (extract_unsigned_integer (buf, SPARC_INTREG_SIZE));
}
/* Since an individual frame in the frame cache is defined by two
LONGJMP_TARGET_SIZE))
return 0;
- *pc = extract_address (buf, LONGJMP_TARGET_SIZE);
+ *pc = extract_unsigned_integer (buf, LONGJMP_TARGET_SIZE);
return 1;
}
if (target_read_memory (jb_addr + 12, buf, sizeof (buf)))
return 0;
- *pc = extract_address (buf, sizeof (buf));
+ *pc = extract_unsigned_integer (buf, sizeof (buf));
return 1;
}
if (target_read_memory (jb_addr + 16, buf, sizeof (buf)))
return 0;
- *pc = extract_address (buf, sizeof (buf));
+ *pc = extract_unsigned_integer (buf, sizeof (buf));
return 1;
}
{
CORE_ADDR regval;
- regval = extract_address (val, v850_register_raw_size (argreg));
+ regval = extract_unsigned_integer (val, v850_register_raw_size (argreg));
write_register (argreg, regval);
len -= v850_register_raw_size (argreg);
/* Aggregates and return values > 8 bytes are returned in memory,
pointed to by R6. */
return_buffer =
- extract_address (regbuf + REGISTER_BYTE (E_V0_REGNUM),
- REGISTER_RAW_SIZE (E_V0_REGNUM));
+ extract_unsigned_integer (regbuf + REGISTER_BYTE (E_V0_REGNUM),
+ REGISTER_RAW_SIZE (E_V0_REGNUM));
read_memory (return_buffer, valbuf, TYPE_LENGTH (type));
}
static CORE_ADDR
v850_extract_struct_value_address (char *regbuf)
{
- return extract_address (regbuf + v850_register_byte (E_V0_REGNUM),
- v850_register_raw_size (E_V0_REGNUM));
+ return extract_unsigned_integer (regbuf + v850_register_byte (E_V0_REGNUM),
+ v850_register_raw_size (E_V0_REGNUM));
}
static void
static CORE_ADDR
vax_extract_struct_value_address (char *regbuf)
{
- return (extract_address (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
+ return (extract_unsigned_integer (regbuf + REGISTER_BYTE (0),
+ REGISTER_RAW_SIZE (0)));
}
\f
static const unsigned char *
/* Aggregates and return values > 12 bytes are returned in memory,
pointed to by R2. */
return_buffer =
- extract_address (regbuf + REGISTER_BYTE (E_PTR_RET_REGNUM),
- REGISTER_RAW_SIZE (E_PTR_RET_REGNUM));
+ extract_unsigned_integer (regbuf + REGISTER_BYTE (E_PTR_RET_REGNUM),
+ REGISTER_RAW_SIZE (E_PTR_RET_REGNUM));
read_memory (return_buffer, valbuf, TYPE_LENGTH (type));
}
static CORE_ADDR
xstormy16_extract_struct_value_address (char *regbuf)
{
- return extract_address (regbuf +
- xstormy16_register_byte (E_PTR_RET_REGNUM),
- xstormy16_reg_size);
+ return extract_unsigned_integer (regbuf + xstormy16_register_byte (E_PTR_RET_REGNUM),
+ xstormy16_reg_size);
}
/* Function: xstormy16_use_struct_convention
xstormy16_pointer_to_address (struct type *type, const void *buf)
{
enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
- CORE_ADDR addr = extract_address (buf, TYPE_LENGTH (type));
+ CORE_ADDR addr = extract_unsigned_integer (buf, TYPE_LENGTH (type));
if (target == TYPE_CODE_FUNC || target == TYPE_CODE_METHOD)
{