diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-05-13 19:27:28 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-05-13 19:27:28 +0000 |
commit | fbd9dcd3c22f292c2c850359701de6ddb3b26a74 (patch) | |
tree | e7db7fd1fcd9d11118ddc42f41e4c646a6dc65c5 | |
parent | 99573a9826100788aa373724588c2124e2612051 (diff) | |
download | gdb-fbd9dcd3c22f292c2c850359701de6ddb3b26a74.zip gdb-fbd9dcd3c22f292c2c850359701de6ddb3b26a74.tar.gz gdb-fbd9dcd3c22f292c2c850359701de6ddb3b26a74.tar.bz2 |
2003-05-13 Andrew Cagney <cagney@redhat.com>
* defs.h (store_address): Delete declaration.
findvar.c (store_address): Delete function.
* arm-tdep.c (arm_push_dummy_call): Replace store_address with
store_unsigned_integer.
* xstormy16-tdep.c (xstormy16_address_to_pointer): Ditto.
* v850-tdep.c (v850_push_arguments): Ditto.
* sparc-tdep.c (sparc_get_saved_register): Ditto.
* sh-tdep.c (sh64_get_saved_register): Ditto.
* rs6000-tdep.c (rs6000_push_arguments): Ditto.
* ppc-sysv-tdep.c (ppc_sysv_abi_push_arguments): Ditto.
* mips-tdep.c (mips_eabi_push_arguments): Ditto.
(mips_get_saved_register): Ditto.
* ia64-tdep.c (ia64_get_saved_register): Ditto.
(find_func_descr, ia64_push_arguments): Ditto.
* i386-tdep.c (i386_push_arguments): Ditto.
* hpux-thread.c (hpux_thread_fetch_registers): Ditto.
* frv-tdep.c (frv_push_arguments): Ditto.
* frame.c (legacy_saved_regs_prev_register): Ditto.
(deprecated_generic_get_saved_register): Ditto.
* findvar.c (unsigned_address_to_pointer): Ditto.
* dwarf2read.c (dwarf2_const_value): Ditto.
* arm-linux-tdep.c (arm_linux_push_arguments): Ditto.
* alpha-tdep.c (alpha_push_arguments): Ditto.
-rw-r--r-- | gdb/ChangeLog | 26 | ||||
-rw-r--r-- | gdb/alpha-tdep.c | 12 | ||||
-rw-r--r-- | gdb/arm-linux-tdep.c | 2 | ||||
-rw-r--r-- | gdb/arm-tdep.c | 2 | ||||
-rw-r--r-- | gdb/defs.h | 2 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 6 | ||||
-rw-r--r-- | gdb/findvar.c | 20 | ||||
-rw-r--r-- | gdb/frame.c | 13 | ||||
-rw-r--r-- | gdb/frv-tdep.c | 2 | ||||
-rw-r--r-- | gdb/hpux-thread.c | 2 | ||||
-rw-r--r-- | gdb/i386-tdep.c | 2 | ||||
-rw-r--r-- | gdb/ia64-tdep.c | 28 | ||||
-rw-r--r-- | gdb/mips-tdep.c | 4 | ||||
-rw-r--r-- | gdb/ppc-sysv-tdep.c | 4 | ||||
-rw-r--r-- | gdb/rs6000-tdep.c | 2 | ||||
-rw-r--r-- | gdb/sh-tdep.c | 4 | ||||
-rw-r--r-- | gdb/sparc-tdep.c | 4 | ||||
-rw-r--r-- | gdb/v850-tdep.c | 2 | ||||
-rw-r--r-- | gdb/xstormy16-tdep.c | 2 |
19 files changed, 77 insertions, 62 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6c83205..f667343 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,29 @@ +2003-05-13 Andrew Cagney <cagney@redhat.com> + + * defs.h (store_address): Delete declaration. + findvar.c (store_address): Delete function. + * arm-tdep.c (arm_push_dummy_call): Replace store_address with + store_unsigned_integer. + * xstormy16-tdep.c (xstormy16_address_to_pointer): Ditto. + * v850-tdep.c (v850_push_arguments): Ditto. + * sparc-tdep.c (sparc_get_saved_register): Ditto. + * sh-tdep.c (sh64_get_saved_register): Ditto. + * rs6000-tdep.c (rs6000_push_arguments): Ditto. + * ppc-sysv-tdep.c (ppc_sysv_abi_push_arguments): Ditto. + * mips-tdep.c (mips_eabi_push_arguments): Ditto. + (mips_get_saved_register): Ditto. + * ia64-tdep.c (ia64_get_saved_register): Ditto. + (find_func_descr, ia64_push_arguments): Ditto. + * i386-tdep.c (i386_push_arguments): Ditto. + * hpux-thread.c (hpux_thread_fetch_registers): Ditto. + * frv-tdep.c (frv_push_arguments): Ditto. + * frame.c (legacy_saved_regs_prev_register): Ditto. + (deprecated_generic_get_saved_register): Ditto. + * findvar.c (unsigned_address_to_pointer): Ditto. + * dwarf2read.c (dwarf2_const_value): Ditto. + * arm-linux-tdep.c (arm_linux_push_arguments): Ditto. + * alpha-tdep.c (alpha_push_arguments): Ditto. + 2003-05-12 J. Brobecker <brobecker@gnat.com> * NEWS: Mention that the hppa-hpux port has been partially diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index c1648b4..74f4f7d 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -1146,7 +1146,9 @@ alpha_push_arguments (int nargs, struct value **args, CORE_ADDR sp, write_memory (sp + m_arg->offset, m_arg->contents, m_arg->len); if (struct_return) { - store_address (raw_buffer, sizeof (CORE_ADDR), struct_addr); + /* NOTE: cagney/2003-05-09: Using sizeof CORE_ADDR here is just + wrong. */ + store_unsigned_integer (raw_buffer, sizeof (CORE_ADDR), struct_addr); write_memory (sp, raw_buffer, sizeof (CORE_ADDR)); } @@ -1226,7 +1228,7 @@ alpha_push_dummy_frame (void) registers follow in ascending order. The PC is saved immediately below the SP. */ save_address = sp + PROC_REG_OFFSET (proc_desc); - store_address (raw_buffer, 8, read_register (ALPHA_RA_REGNUM)); + store_unsigned_integer (raw_buffer, 8, read_register (ALPHA_RA_REGNUM)); write_memory (save_address, raw_buffer, 8); save_address += 8; mask = PROC_REG_MASK (proc_desc) & 0xffffffffL; @@ -1235,12 +1237,12 @@ alpha_push_dummy_frame (void) { if (ireg == ALPHA_RA_REGNUM) continue; - store_address (raw_buffer, 8, read_register (ireg)); + store_unsigned_integer (raw_buffer, 8, read_register (ireg)); write_memory (save_address, raw_buffer, 8); save_address += 8; } - store_address (raw_buffer, 8, read_register (PC_REGNUM)); + store_unsigned_integer (raw_buffer, 8, read_register (PC_REGNUM)); write_memory (sp - 8, raw_buffer, 8); /* Save floating point registers. */ @@ -1249,7 +1251,7 @@ alpha_push_dummy_frame (void) for (ireg = 0; mask; ireg++, mask >>= 1) if (mask & 1) { - store_address (raw_buffer, 8, read_register (ireg + FP0_REGNUM)); + store_unsigned_integer (raw_buffer, 8, read_register (ireg + FP0_REGNUM)); write_memory (save_address, raw_buffer, 8); save_address += 8; } diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 60c8ae4..9debbeb 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -195,7 +195,7 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp, { CORE_ADDR regval = extract_address (val, len); if (arm_pc_is_thumb (regval)) - store_address (val, len, MAKE_THUMB_ADDR (regval)); + store_unsigned_integer (val, len, MAKE_THUMB_ADDR (regval)); } /* Copy the argument to general registers or the stack in diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index d2e3ef5..59fa269 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1468,7 +1468,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct regcache *regcache, if (arm_pc_is_thumb (regval)) { val = alloca (len); - store_address (val, len, MAKE_THUMB_ADDR (regval)); + store_unsigned_integer (val, len, MAKE_THUMB_ADDR (regval)); } } @@ -1134,8 +1134,6 @@ extern void store_signed_integer (void *, int, LONGEST); extern void store_unsigned_integer (void *, int, ULONGEST); -extern void store_address (void *, int, LONGEST); - extern void store_typed_address (void *buf, struct type *type, CORE_ADDR addr); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index a0a2f9b..6359337 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -5319,8 +5319,10 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym, (sym))); SYMBOL_VALUE_BYTES (sym) = (char *) obstack_alloc (&objfile->symbol_obstack, cu_header->addr_size); - store_address (SYMBOL_VALUE_BYTES (sym), cu_header->addr_size, - DW_ADDR (attr)); + /* NOTE: cagney/2003-05-09: In-lined store_address call with + it's body - store_unsigned_integer. */ + store_unsigned_integer (SYMBOL_VALUE_BYTES (sym), cu_header->addr_size, + DW_ADDR (attr)); SYMBOL_CLASS (sym) = LOC_CONST_BYTES; break; case DW_FORM_block1: diff --git a/gdb/findvar.c b/gdb/findvar.c index ca371d2..c9623bf 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -252,24 +252,6 @@ store_unsigned_integer (void *addr, int len, ULONGEST val) } } -/* Store the address VAL as a LEN-byte value in target byte order at - ADDR. 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 store_typed_address instead, or something else - based on ADDRESS_TO_POINTER. */ -void -store_address (void *addr, int len, LONGEST val) -{ - store_unsigned_integer (addr, len, val); -} - - /* Store the address ADDR as a pointer of type TYPE at BUF, in target form. */ void @@ -365,7 +347,7 @@ signed_pointer_to_address (struct type *type, const void *buf) void unsigned_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr) { - store_address (buf, TYPE_LENGTH (type), addr); + store_unsigned_integer (buf, TYPE_LENGTH (type), addr); } void diff --git a/gdb/frame.c b/gdb/frame.c index a664b97..3eac390 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -983,8 +983,10 @@ legacy_saved_regs_prev_register (struct frame_info *next_frame, *addrp = 0; *realnump = -1; if (bufferp != NULL) - store_address (bufferp, REGISTER_RAW_SIZE (regnum), - get_frame_saved_regs (frame)[regnum]); + /* NOTE: cagney/2003-05-09: In-lined store_address with + it's body - store_unsigned_integer. */ + store_unsigned_integer (bufferp, REGISTER_RAW_SIZE (regnum), + get_frame_saved_regs (frame)[regnum]); } else { @@ -1125,8 +1127,11 @@ deprecated_generic_get_saved_register (char *raw_buffer, int *optimized, if (regnum == SP_REGNUM) { if (raw_buffer) /* SP register treated specially */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - get_frame_saved_regs (frame)[regnum]); + /* NOTE: cagney/2003-05-09: In-line store_address + with it's body - store_unsigned_integer. */ + store_unsigned_integer (raw_buffer, + REGISTER_RAW_SIZE (regnum), + get_frame_saved_regs (frame)[regnum]); } else { diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index ce02b7f..4d8f3fe 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -843,7 +843,7 @@ frv_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION) { - store_address (valbuf, 4, VALUE_ADDRESS (arg)); + store_unsigned_integer (valbuf, 4, VALUE_ADDRESS (arg)); typecode = TYPE_CODE_PTR; len = 4; val = valbuf; diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c index 7a7b741..02f5acd 100644 --- a/gdb/hpux-thread.c +++ b/gdb/hpux-thread.c @@ -294,7 +294,7 @@ hpux_thread_fetch_registers (int regno) /* Flags must be 0 to avoid bogus value for SS_INSYSCALL */ memset (buf, '\000', REGISTER_RAW_SIZE (regno)); else if (regno == SP_REGNUM) - store_address (buf, sizeof sp, sp); + store_unsigned_integer (buf, sizeof sp, sp); else if (regno == PC_REGNUM) read_memory (sp - 20, buf, REGISTER_RAW_SIZE (regno)); else diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 5cf63b4..66d697d 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -864,7 +864,7 @@ i386_push_arguments (int nargs, struct value **args, CORE_ADDR sp, char buf[4]; sp -= 4; - store_address (buf, 4, struct_addr); + store_unsigned_integer (buf, 4, struct_addr); write_memory (sp, buf, 4); } diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index ce9b26c..2713046 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -1239,13 +1239,13 @@ ia64_get_saved_register (char *raw_buffer, if (regnum == SP_REGNUM && get_next_frame (frame)) { /* Handle SP values for all frames but the topmost. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - get_frame_base (frame)); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), + get_frame_base (frame)); } else if (regnum == IA64_BSP_REGNUM) { - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - get_frame_extra_info (frame)->bsp); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), + get_frame_extra_info (frame)->bsp); } else if (regnum == IA64_VFP_REGNUM) { @@ -1255,7 +1255,7 @@ ia64_get_saved_register (char *raw_buffer, still provide a value since we know the size of the frame */ CORE_ADDR vfp = (get_frame_base (frame) + get_frame_extra_info (frame)->mem_stack_frame_size); - store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (IA64_VFP_REGNUM), vfp); } else if (IA64_PR0_REGNUM <= regnum && regnum <= IA64_PR63_REGNUM) { @@ -1338,7 +1338,7 @@ ia64_get_saved_register (char *raw_buffer, { pc = read_pc (); } - store_address (raw_buffer, REGISTER_RAW_SIZE (IA64_IP_REGNUM), pc); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (IA64_IP_REGNUM), pc); } else if (IA64_GR32_REGNUM <= regnum && regnum <= IA64_GR127_REGNUM) { @@ -1769,8 +1769,8 @@ find_func_descr (CORE_ADDR faddr, CORE_ADDR *fdaptr) if (global_pointer == 0) global_pointer = read_register (IA64_GR1_REGNUM); - store_address (buf, 8, faddr); - store_address (buf + 8, 8, global_pointer); + store_unsigned_integer (buf, 8, faddr); + store_unsigned_integer (buf + 8, 8, global_pointer); write_memory (fdesc, buf, 16); } @@ -1862,9 +1862,9 @@ ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, { char val_buf[8]; - store_address (val_buf, 8, - find_func_descr (extract_address (VALUE_CONTENTS (arg), 8), - &funcdescaddr)); + store_unsigned_integer (val_buf, 8, + find_func_descr (extract_address (VALUE_CONTENTS (arg), 8), + &funcdescaddr)); if (slotnum < rseslots) write_memory (rse_address_add (bsp, slotnum), val_buf, 8); else @@ -1920,9 +1920,9 @@ ia64_push_arguments (int nargs, struct value **args, CORE_ADDR sp, /* Store the struct return value in r8 if necessary. */ if (struct_return) { - store_address (&deprecated_registers[REGISTER_BYTE (IA64_GR8_REGNUM)], - REGISTER_RAW_SIZE (IA64_GR8_REGNUM), - struct_addr); + store_unsigned_integer (&deprecated_registers[REGISTER_BYTE (IA64_GR8_REGNUM)], + REGISTER_RAW_SIZE (IA64_GR8_REGNUM), + struct_addr); } /* Sync gdb's idea of what the registers are with the target. */ diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index bf19ed8..57ee0df 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -2767,7 +2767,7 @@ mips_eabi_push_arguments (int nargs, if (len > MIPS_SAVED_REGSIZE && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) { - store_address (valbuf, MIPS_SAVED_REGSIZE, VALUE_ADDRESS (arg)); + store_unsigned_integer (valbuf, MIPS_SAVED_REGSIZE, VALUE_ADDRESS (arg)); typecode = TYPE_CODE_PTR; len = MIPS_SAVED_REGSIZE; val = valbuf; @@ -5442,7 +5442,7 @@ mips_get_saved_register (char *raw_buffer, /* Only MIPS_SAVED_REGSIZE bytes of GP registers are saved. */ LONGEST val = read_memory_integer ((*addrp), MIPS_SAVED_REGSIZE); - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), val); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), val); } } } diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index 9894a58..6e8216c 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -180,7 +180,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, write_register (SP_REGNUM, sp); /* write the backchain */ - store_address (old_sp_buf, 4, saved_sp); + store_unsigned_integer (old_sp_buf, 4, saved_sp); write_memory (sp, old_sp_buf, 4); argoffset = 8; @@ -261,7 +261,7 @@ ppc_sysv_abi_push_arguments (int nargs, struct value **args, CORE_ADDR sp, || TYPE_CODE (type) == TYPE_CODE_UNION) { write_memory (sp + structoffset, val, len); - store_address (val_buf, 4, sp + structoffset); + store_unsigned_integer (val_buf, 4, sp + structoffset); structoffset += round2 (len, 8); } else diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 0b239bd..14a7e22 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -1269,7 +1269,7 @@ ran_out_of_registers_for_arguments: write_register (SP_REGNUM, sp); /* set back chain properly */ - store_address (tmp_buffer, 4, saved_sp); + store_unsigned_integer (tmp_buffer, 4, saved_sp); write_memory (sp, tmp_buffer, 4); target_store_registers (-1); diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 0ef65de..1c7a1dd 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -1873,8 +1873,8 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, if (regnum == SP_REGNUM) { if (raw_buffer) /* SP register treated specially */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), - get_frame_saved_regs (frame)[regnum]); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), + get_frame_saved_regs (frame)[regnum]); } else { /* any other register */ diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 7f0ae4b..cf5d9c5 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -859,7 +859,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, if (raw_buffer != NULL) { /* Put it back in target format. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), get_frame_pc (frame)); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), get_frame_pc (frame)); } if (addrp != NULL) *addrp = 0; @@ -967,7 +967,7 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp, if (raw_buffer != NULL) { /* Put it back in target format. */ - store_address (raw_buffer, REGISTER_RAW_SIZE (regnum), addr); + store_unsigned_integer (raw_buffer, REGISTER_RAW_SIZE (regnum), addr); } if (addrp != NULL) *addrp = 0; diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 1828d1c..e6b238e 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -958,7 +958,7 @@ v850_push_arguments (int nargs, struct value **args, CORE_ADDR sp, if (!v850_type_is_scalar (VALUE_TYPE (*args)) && TYPE_LENGTH (VALUE_TYPE (*args)) > E_MAX_RETTYPE_SIZE_IN_REGS) { - store_address (valbuf, 4, VALUE_ADDRESS (*args)); + store_unsigned_integer (valbuf, 4, VALUE_ADDRESS (*args)); len = 4; val = valbuf; } diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index d6aa018..7f170e9 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -985,7 +985,7 @@ xstormy16_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr) if (addr2) addr = addr2; } - store_address (buf, TYPE_LENGTH (type), addr); + store_unsigned_integer (buf, TYPE_LENGTH (type), addr); } static CORE_ADDR |