* 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-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.
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)
{
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)
{
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
{ \
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
#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)); \
}
/* 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.
/* 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;
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);
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. */
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;
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);
}
/* 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.
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
{
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");
{
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
{
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));
{
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));
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)
{
else
floatformat_to_doublest (&floatformat_ieee_double_big,
(char *) regbuf + offset, &val);
- store_floating (valbuf, len, val);
+ deprecated_store_floating (valbuf, len, val);
}
}
else
{
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");
{
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");
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
|| (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
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);