2003-05-13 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Tue, 13 May 2003 19:27:28 +0000 (19:27 +0000)
committerAndrew Cagney <cagney@redhat.com>
Tue, 13 May 2003 19:27:28 +0000 (19:27 +0000)
* 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.

19 files changed:
gdb/ChangeLog
gdb/alpha-tdep.c
gdb/arm-linux-tdep.c
gdb/arm-tdep.c
gdb/defs.h
gdb/dwarf2read.c
gdb/findvar.c
gdb/frame.c
gdb/frv-tdep.c
gdb/hpux-thread.c
gdb/i386-tdep.c
gdb/ia64-tdep.c
gdb/mips-tdep.c
gdb/ppc-sysv-tdep.c
gdb/rs6000-tdep.c
gdb/sh-tdep.c
gdb/sparc-tdep.c
gdb/v850-tdep.c
gdb/xstormy16-tdep.c

index 6c832059b07e1df59da75f712d1ae4f51be4c158..f667343f0b7935f8f01807f56d496acc9499874f 100644 (file)
@@ -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
index c1648b48b487f5a31e80a4ae68d9be144f156f6b..74f4f7da5d400776394f3978e12322c10af65bfe 100644 (file)
@@ -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;
       }
index 60c8ae492a9b3069104f244d80d78f7d1d236cd2..9debbeb494878b42165dee7ee795c9b9a7eb3a15 100644 (file)
@@ -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
index d2e3ef598a058013d20949b86a96e9f95dcdd9cd..59fa2696221e70225d352859ebfe538f6a3a9b11 100644 (file)
@@ -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));
            }
        }
 
index d442783063953144826078aebb988f8df28e0f57..a90ef9ef7c0fcb58eef961b3efa461f0a4145208 100644 (file)
@@ -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);
 
 \f
index a0a2f9beaaac147c23be2633f8ce8c49606d1d84..635933789cff95add00b19368f938709a1b7ceac 100644 (file)
@@ -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:
index ca371d21e03e70453ceb5c2f131f68a538b925ab..c9623bf2c4d87802a856fa3062177fc30598b0cf 100644 (file)
@@ -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
index a664b97999b60c8e7f8ff096478b5598f8a25f1e..3eac39057a6b6b5d42c523260b2a9d4a5b2576fc 100644 (file)
@@ -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
                {
index ce02b7fc6a85efe02f10c73999be9bf0a4668fdf..4d8f3fe3cbfb6fece07a0c99508552d9e17d083d 100644 (file)
@@ -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;
index 7a7b74174a103be95c269540af710f70562ba98c..02f5acd9a90ace97aef4a6d53d2ad26f0465207e 100644 (file)
@@ -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
index 5cf63b46f869369cc383fc6a1e98a1680bd23b5b..66d697d780fb58d2ee860bd72870434c23d6a126 100644 (file)
@@ -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);
     }
 
index ce9b26c8e2eaedbac9cdd83bff1272bc0a788437..27130469e4e6c6b412c1e7cd160ba8bc7e8da204 100644 (file)
@@ -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. */
index bf19ed8d9999a4609dd3c8cf85f24b1e168bd9e2..57ee0dfa4d59cdad8b19beb74e32fb44eb7a452d 100644 (file)
@@ -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);
            }
        }
     }
index 9894a5883e26920ebcae9391ed1ce438c718c31b..6e8216cdc227e3bc0f00501bab222ade91eb5099 100644 (file)
@@ -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
index 0b239bd418002555945423205e4c6e1b15456793..14a7e2210fca3d4db8764e5aff5c40a0a3950b1f 100644 (file)
@@ -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);
index 0ef65de2c024f40f6bd9d361150f7ed2f787995e..1c7a1dd2532c0e05eac34102335821ee3650a21d 100644 (file)
@@ -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 */
index 7f0ae4b20469101ad3b2e59a5975226677fe5128..cf5d9c5ec0b53e79626fd8c36501059f19a2b64b 100644 (file)
@@ -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;
index 1828d1c74df35ebceca9b3c1c32c81528b9bb1bf..e6b238e112e7406aa05e78f2f0f88189570ba533 100644 (file)
@@ -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;
        }
index d6aa0183e1e1777b5ec7fff590ad28b98bf82904..7f170e909d9b2ffbf043192c578877b2b4b2f291 100644 (file)
@@ -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