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 | ca0114bfef1c3fd8fcb18e91084d5cfb0e9808de (patch) | |
tree | 52e4ad5bd495ea2d7afb7235ecbc506ebc0fb396 | |
parent | 99fe16723388b9925a5300096a654b5fa08b444b (diff) | |
download | gdb-ca0114bfef1c3fd8fcb18e91084d5cfb0e9808de.tar.gz |
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 6c832059b07..f667343f0b7 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 c1648b48b48..74f4f7da5d4 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 60c8ae492a9..9debbeb4948 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 d2e3ef598a0..59fa2696221 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)); } } diff --git a/gdb/defs.h b/gdb/defs.h index d4427830639..a90ef9ef7c0 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -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 a0a2f9beaaa..635933789cf 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 ca371d21e03..c9623bf2c4d 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 a664b97999b..3eac39057a6 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 ce02b7fc6a8..4d8f3fe3cbf 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 7a7b74174a1..02f5acd9a90 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 5cf63b46f86..66d697d780f 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 ce9b26c8e2e..27130469e4e 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 bf19ed8d999..57ee0dfa4d5 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 9894a5883e2..6e8216cdc22 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 0b239bd4180..14a7e2210fc 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 0ef65de2c02..1c7a1dd2532 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 7f0ae4b2046..cf5d9c5ec0b 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 1828d1c74df..e6b238e112e 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 d6aa0183e1e..7f170e909d9 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 |