]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2003-04-09 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Wed, 9 Apr 2003 15:08:27 +0000 (15:08 +0000)
committerAndrew Cagney <cagney@redhat.com>
Wed, 9 Apr 2003 15:08:27 +0000 (15:08 +0000)
* doublest.h: Update copyright.
(deprecated_store_floating, deprecated_extract_floating): Rename
store_floating and extract_floating.  Update comments.
* doublest.c: Update copyright.
(extract_floating_by_length): Replace extract_floating.
(store_floating_by_length): Replace store_floating.
(deprecated_extract_floating): New function.
(deprecated_store_floating): New function.
(extract_typed_floating): Call extract_floating_by_length.
(store_typed_floating): Call store_floating_by_length.
* x86-64-tdep.c (x86_64_store_return_value): Update.
* sh-tdep.c (sh3e_sh4_extract_return_value): Update.
(sh64_extract_return_value): Update.
(sh_sh4_register_convert_to_virtual): Update.
(sh_sh64_register_convert_to_virtual): Update.
(sh_sh4_register_convert_to_raw): Update.
(sh_sh64_register_convert_to_raw): Update.
* rs6000-tdep.c (rs6000_register_convert_to_virtual): Update.
(rs6000_register_convert_to_raw): Update.
* ia64-tdep.c (ia64_register_convert_to_virtual): Update.
(ia64_register_convert_to_raw): Update.
* config/i386/tm-symmetry.h (REGISTER_CONVERT_TO_RAW): Update.
(REGISTER_CONVERT_TO_VIRTUAL): Update.
* arm-linux-tdep.c (arm_linux_push_arguments): Update.
* alpha-tdep.c (alpha_register_convert_to_virtual): Update.
(alpha_register_convert_to_raw): Update.

gdb/ChangeLog
gdb/alpha-tdep.c
gdb/arm-linux-tdep.c
gdb/config/i386/tm-symmetry.h
gdb/doublest.c
gdb/doublest.h
gdb/ia64-tdep.c
gdb/rs6000-tdep.c
gdb/sh-tdep.c
gdb/x86-64-tdep.c

index a86fe644a7a4956e6ebaafdc7142b0695c040505..8c4ec78c12127f47a18c92a2f0e2cb72139c5542 100644 (file)
@@ -1,3 +1,32 @@
+2003-04-09  Andrew Cagney  <cagney@redhat.com>
+
+       * doublest.h: Update copyright.
+       (deprecated_store_floating, deprecated_extract_floating): Rename
+       store_floating and extract_floating.  Update comments.
+       * doublest.c: Update copyright.
+       (extract_floating_by_length): Replace extract_floating.
+       (store_floating_by_length): Replace store_floating.
+       (deprecated_extract_floating): New function.
+       (deprecated_store_floating): New function.
+       (extract_typed_floating): Call extract_floating_by_length.
+       (store_typed_floating): Call store_floating_by_length.
+       * x86-64-tdep.c (x86_64_store_return_value): Update.
+       * sh-tdep.c (sh3e_sh4_extract_return_value): Update.
+       (sh64_extract_return_value): Update.
+       (sh_sh4_register_convert_to_virtual): Update.
+       (sh_sh64_register_convert_to_virtual): Update.
+       (sh_sh4_register_convert_to_raw): Update.
+       (sh_sh64_register_convert_to_raw): Update.
+       * rs6000-tdep.c (rs6000_register_convert_to_virtual): Update.
+       (rs6000_register_convert_to_raw): Update.
+       * ia64-tdep.c (ia64_register_convert_to_virtual): Update.
+       (ia64_register_convert_to_raw): Update.
+       * config/i386/tm-symmetry.h (REGISTER_CONVERT_TO_RAW): Update.
+       (REGISTER_CONVERT_TO_VIRTUAL): Update.
+       * arm-linux-tdep.c (arm_linux_push_arguments): Update.
+       * alpha-tdep.c (alpha_register_convert_to_virtual): Update.
+       (alpha_register_convert_to_raw): Update.
+
 2003-04-08  Andrew Cagney  <cagney@redhat.com>
 
        * gdbarch.sh (SAVED_PC_AFTER_CALL): Add a predicate.
index fc61140d3cbb5ec903b3f2657c4bb716ac4d1167..2cbec4ef413ed905f14de1ec6d9ff198284f728c 100644 (file)
@@ -1458,8 +1458,8 @@ alpha_register_convert_to_virtual (int regnum, struct type *valtype,
 
   if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
     {
-      double d = extract_floating (raw_buffer, REGISTER_RAW_SIZE (regnum));
-      store_floating (virtual_buffer, TYPE_LENGTH (valtype), d);
+      double d = deprecated_extract_floating (raw_buffer, REGISTER_RAW_SIZE (regnum));
+      deprecated_store_floating (virtual_buffer, TYPE_LENGTH (valtype), d);
     }
   else if (TYPE_CODE (valtype) == TYPE_CODE_INT && TYPE_LENGTH (valtype) <= 4)
     {
@@ -1484,8 +1484,8 @@ alpha_register_convert_to_raw (struct type *valtype, int regnum,
 
   if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
     {
-      double d = extract_floating (virtual_buffer, TYPE_LENGTH (valtype));
-      store_floating (raw_buffer, REGISTER_RAW_SIZE (regnum), d);
+      double d = deprecated_extract_floating (virtual_buffer, TYPE_LENGTH (valtype));
+      deprecated_store_floating (raw_buffer, REGISTER_RAW_SIZE (regnum), d);
     }
   else if (TYPE_CODE (valtype) == TYPE_CODE_INT && TYPE_LENGTH (valtype) <= 4)
     {
index fa4d8fa00ca7ff2bc04fd3b17b71cb8b7a3dc30a..781d4204a2ceb5ae510c0b2b8a19601c6a145f3f 100644 (file)
@@ -181,10 +181,10 @@ arm_linux_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
       if (TYPE_CODE_FLT == typecode && REGISTER_SIZE == len)
        {
          DOUBLEST dblval;
-         dblval = extract_floating (val, len);
+         dblval = deprecated_extract_floating (val, len);
          len = TARGET_DOUBLE_BIT / TARGET_CHAR_BIT;
          val = alloca (len);
-         store_floating (val, len, dblval);
+         deprecated_store_floating (val, len, dblval);
        }
 
       /* If the argument is a pointer to a function, and it is a Thumb
index ea2229090e7a99244768c9d4f91aac6e210da73b..282556201c64560d4d71b879adbcf6503caf27c6 100644 (file)
@@ -236,7 +236,7 @@ switch (regno) { \
 { \
   DOUBLEST val; \
   floatformat_to_doublest (&floatformat_i387_ext, (FROM), &val); \
-  store_floating ((TO), TYPE_LENGTH (TYPE), val); \
+  deprecated_store_floating ((TO), TYPE_LENGTH (TYPE), val); \
 }
 
 /* Convert data from virtual format with type TYPE in buffer FROM
@@ -245,7 +245,7 @@ switch (regno) { \
 #undef REGISTER_CONVERT_TO_RAW
 #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
 { \
-  DOUBLEST val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
+  DOUBLEST val = deprecated_extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
   floatformat_from_doublest (&floatformat_i387_ext, &val, (TO)); \
 }
 
index 3f68273877c66f605144cda998a487e21e21f5d5..101240b5b6df28dad997b096b4504bb3c0670903 100644 (file)
@@ -1,7 +1,8 @@
 /* Floating point routines for GDB, the GNU debugger.
-   Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-   1997, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+
+   Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001, 2003 Free Software Foundation,
+   Inc.
 
    This file is part of GDB.
 
@@ -663,8 +664,8 @@ floatformat_from_type (const struct type *type)
 /* Extract a floating-point number of length LEN from a target-order
    byte-stream at ADDR.  Returns the value as type DOUBLEST.  */
 
-DOUBLEST
-extract_floating (const void *addr, int len)
+static DOUBLEST
+extract_floating_by_length (const void *addr, int len)
 {
   const struct floatformat *fmt = floatformat_from_length (len);
   DOUBLEST val;
@@ -679,11 +680,17 @@ extract_floating (const void *addr, int len)
   return val;
 }
 
+DOUBLEST
+deprecated_extract_floating (const void *addr, int len)
+{
+  return extract_floating_by_length (addr, len);
+}
+
 /* Store VAL as a floating-point number of length LEN to a
    target-order byte-stream at ADDR.  */
 
-void
-store_floating (void *addr, int len, DOUBLEST val)
+static void
+store_floating_by_length (void *addr, int len, DOUBLEST val)
 {
   const struct floatformat *fmt = floatformat_from_length (len);
 
@@ -697,6 +704,12 @@ store_floating (void *addr, int len, DOUBLEST val)
   floatformat_from_doublest (fmt, &val, addr);
 }
 
+void
+deprecated_store_floating (void *addr, int len, DOUBLEST val)
+{
+  store_floating_by_length (addr, len, val);
+}
+
 /* Extract a floating-point number of type TYPE from a target-order
    byte-stream at ADDR.  Returns the value as type DOUBLEST.  */
 
@@ -708,7 +721,9 @@ extract_typed_floating (const void *addr, const struct type *type)
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
 
   if (TYPE_FLOATFORMAT (type) == NULL)
-    return extract_floating (addr, TYPE_LENGTH (type));
+    /* Not all code remembers to set the FLOATFORMAT (language
+       specific code? stabs?) so handle that here as a special case.  */
+    return extract_floating_by_length (addr, TYPE_LENGTH (type));
 
   floatformat_to_doublest (TYPE_FLOATFORMAT (type), addr, &retval);
   return retval;
@@ -743,7 +758,9 @@ store_typed_floating (void *addr, const struct type *type, DOUBLEST val)
   memset (addr, 0, TYPE_LENGTH (type));
 
   if (TYPE_FLOATFORMAT (type) == NULL)
-    store_floating (addr, TYPE_LENGTH (type), val);
+    /* Not all code remembers to set the FLOATFORMAT (language
+       specific code? stabs?) so handle that here as a special case.  */
+    store_floating_by_length (addr, TYPE_LENGTH (type), val);
   else
     floatformat_from_doublest (TYPE_FLOATFORMAT (type), &val, addr);
 }
index 920d7026db4fe74d9307de4a5debbbf40586133e..d98d045c987d6fd27f934ba35baf715f0730c750 100644 (file)
@@ -1,7 +1,8 @@
 /* Floating point definitions for GDB.
-   Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-   1997, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+
+   Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001, 2003 Free Software Foundation,
+   Inc.
 
    This file is part of GDB.
 
@@ -59,12 +60,16 @@ extern int floatformat_is_negative (const struct floatformat *, char *);
 extern int floatformat_is_nan (const struct floatformat *, char *);
 extern char *floatformat_mantissa (const struct floatformat *, char *);
 
-/* These two functions are deprecated in favour of
-   extract_typed_floating and store_typed_floating.  See comments in
-   'doublest.c' for details.  */
+/* These functions have been replaced by extract_typed_floating and
+   store_typed_floating.
+
+   Most calls are passing in TYPE_LENGTH (TYPE) so can be changed to
+   just pass the TYPE.  The remainder pass in the length of a
+   register, those calls should instead pass in the floating point
+   type that corresponds to that length.  */
 
-extern DOUBLEST extract_floating (const void *addr, int len);
-extern void store_floating (void *addr, int len, DOUBLEST val);
+extern DOUBLEST deprecated_extract_floating (const void *addr, int len);
+extern void deprecated_store_floating (void *addr, int len, DOUBLEST val);
 
 /* Given TYPE, return its floatformat.  TYPE_FLOATFORMAT() may return
    NULL.  type_floatformat() detects that and returns a floatformat
index 5e46d6b8f408c5c0157e13e8d0d98e6880e142cb..7abd7ea3321871cc9ec21d07ce9db9e0dc8c6665 100644 (file)
@@ -273,7 +273,7 @@ ia64_register_convert_to_virtual (int regnum, struct type *type,
     {
       DOUBLEST val;
       floatformat_to_doublest (&floatformat_ia64_ext, from, &val);
-      store_floating(to, TYPE_LENGTH(type), val);
+      deprecated_store_floating (to, TYPE_LENGTH(type), val);
     }
   else
     error("ia64_register_convert_to_virtual called with non floating point register number");
@@ -285,7 +285,7 @@ ia64_register_convert_to_raw (struct type *type, int regnum,
 {
   if (regnum >= IA64_FR0_REGNUM && regnum <= IA64_FR127_REGNUM)
     {
-      DOUBLEST val = extract_floating (from, TYPE_LENGTH(type));
+      DOUBLEST val = deprecated_extract_floating (from, TYPE_LENGTH(type));
       floatformat_from_doublest (&floatformat_ia64_ext, &val, to);
     }
   else
index 08394dee1d54fbea56e068850b361e6882eb9e3a..8cba11c19e7c162adc554a995ce5060a579f6b12 100644 (file)
@@ -1892,8 +1892,8 @@ rs6000_register_convert_to_virtual (int n, struct type *type,
 {
   if (TYPE_LENGTH (type) != REGISTER_RAW_SIZE (n))
     {
-      double val = extract_floating (from, REGISTER_RAW_SIZE (n));
-      store_floating (to, TYPE_LENGTH (type), val);
+      double val = deprecated_extract_floating (from, REGISTER_RAW_SIZE (n));
+      deprecated_store_floating (to, TYPE_LENGTH (type), val);
     }
   else
     memcpy (to, from, REGISTER_RAW_SIZE (n));
@@ -1908,8 +1908,8 @@ rs6000_register_convert_to_raw (struct type *type, int n,
 {
   if (TYPE_LENGTH (type) != REGISTER_RAW_SIZE (n))
     {
-      double val = extract_floating (from, TYPE_LENGTH (type));
-      store_floating (to, REGISTER_RAW_SIZE (n), val);
+      double val = deprecated_extract_floating (from, TYPE_LENGTH (type));
+      deprecated_store_floating (to, REGISTER_RAW_SIZE (n), val);
     }
   else
     memcpy (to, from, REGISTER_RAW_SIZE (n));
index d30586c75206d06793c92ddf8f192f387c552996..b61eb2364f3fd132cfdac6bbeecf4b368c91ba8f 100644 (file)
@@ -2414,7 +2414,7 @@ sh3e_sh4_extract_return_value (struct type *type, char *regbuf, char *valbuf)
        floatformat_to_doublest (&floatformat_ieee_double_big,
                                 (char *) regbuf + REGISTER_BYTE (return_register),
                                 &val);
-      store_floating (valbuf, len, val);
+      deprecated_store_floating (valbuf, len, val);
     }
   else if (len <= 4)
     {
@@ -2467,7 +2467,7 @@ sh64_extract_return_value (struct type *type, char *regbuf, char *valbuf)
          else
            floatformat_to_doublest (&floatformat_ieee_double_big,
                                     (char *) regbuf + offset, &val);
-         store_floating (valbuf, len, val);
+         deprecated_store_floating (valbuf, len, val);
        }
     }
   else
@@ -3403,7 +3403,7 @@ sh_sh4_register_convert_to_virtual (int regnum, struct type *type,
     {
       DOUBLEST val;
       floatformat_to_doublest (&floatformat_ieee_double_littlebyte_bigword, from, &val);
-      store_floating (to, TYPE_LENGTH (type), val);
+      deprecated_store_floating (to, TYPE_LENGTH (type), val);
     }
   else
     error ("sh_register_convert_to_virtual called with non DR register number");
@@ -3429,7 +3429,7 @@ sh_sh64_register_convert_to_virtual (int regnum, struct type *type,
     {
       DOUBLEST val;
       floatformat_to_doublest (&floatformat_ieee_double_littlebyte_bigword, from, &val);
-      store_floating(to, TYPE_LENGTH(type), val);
+      deprecated_store_floating(to, TYPE_LENGTH(type), val);
     }
   else
     error("sh_register_convert_to_virtual called with non DR register number");
@@ -3444,7 +3444,7 @@ sh_sh4_register_convert_to_raw (struct type *type, int regnum,
   if (regnum >= tdep->DR0_REGNUM 
       && regnum <= tdep->DR_LAST_REGNUM)
     {
-      DOUBLEST val = extract_floating (from, TYPE_LENGTH(type));
+      DOUBLEST val = deprecated_extract_floating (from, TYPE_LENGTH(type));
       floatformat_from_doublest (&floatformat_ieee_double_littlebyte_bigword, &val, to);
     }
   else
@@ -3469,7 +3469,7 @@ sh_sh64_register_convert_to_raw (struct type *type, int regnum,
       || (regnum >= tdep->DR0_C_REGNUM 
          && regnum <= tdep->DR_LAST_C_REGNUM))
     {
-      DOUBLEST val = extract_floating (from, TYPE_LENGTH(type));
+      DOUBLEST val = deprecated_extract_floating (from, TYPE_LENGTH(type));
       floatformat_from_doublest (&floatformat_ieee_double_littlebyte_bigword, &val, to);
     }
   else
index 24b77af113b5dfe047d7e14a2c5f341d72aa863a..d670ff436dbf75cea248b20d8604438301adbbc0 100644 (file)
@@ -781,7 +781,7 @@ x86_64_store_return_value (struct type *type, struct regcache *regcache,
             floating point format used by the FPU.  This is probably
             not exactly how it would happen on the target itself, but
             it is the best we can do.  */
-         val = extract_floating (valbuf, TYPE_LENGTH (type));
+         val = deprecated_extract_floating (valbuf, TYPE_LENGTH (type));
          floatformat_from_doublest (&floatformat_i387_ext, &val, buf);
          regcache_cooked_write_part (regcache, FP0_REGNUM,
                                      0, FPU_REG_RAW_SIZE, buf);