diff options
author | Andrew Cagney <cagney@redhat.com> | 2001-08-01 18:39:27 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2001-08-01 18:39:27 +0000 |
commit | dbe281d2927ce1c12d49ec753d343f466b5291ed (patch) | |
tree | 2dc081c1939d5607e014c7067e9a6fa62df3d3cc /gdb/findvar.c | |
parent | e1af9243726dcb232163609e2e02d04230085643 (diff) | |
download | gdb-dbe281d2927ce1c12d49ec753d343f466b5291ed.tar.gz |
* defs.h (HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
(HOST_FLOAT_FORMAT, HOST_DOUBLE_FORMAT)
(HOST_LONG_DOUBLE_FORMAT, DOUBLEST)
(floatformat_to_doublest, floatformat_from_doublest)
(floatformat_is_negative, floatformat_is_nan)
(floatformat_mantissa, store_floating)
(extract_floating): Move declaration from here.
* doublest.h: To here. New file.
* utils.c (get_field, floatformat_to_doublest, put_field)
(ldfrexp, floatformat_from_doublest, floatformat_is_negative)
(floatformat_is_nan, floatformat_mantissa)
(FLOATFORMAT_CHAR_BIT): Move from here.
* doublest.c: To here. New file.
* findvar.c (store_floating, extract_floating): Move from here.
* doublest.c: To here.
* Makefile.in (SFILES): Add doublest.c.
(COMMON_OBS): Add doublest.o.
(doublest.o): Specify dependencies.
(doublest_h): Define.
* config/m88k/tm-m88k.h: Include "doublest.h".
* config/i960/tm-i960.h: Ditto.
* config/i386/tm-symmetry.h: Ditto.
* rs6000-tdep.c, valarith.c: Ditto.
* valprint.c, stabsread.c, sh-tdep.c: Ditto.
* ia64-tdep.c, i387-tdep.c, i386-tdep.c: Ditto.
* values.c, arm-tdep.c, arm-linux-tdep.c: Ditto.
* alpha-tdep.c, ax.h, expression.h: Ditto.
* sh-tdep.c, parse.c, top.c, value.h: Ditto.
* Makefile.in (arm-tdep.o): Add $(doublest_h).
(i386-tdep.o, i387-tdep.o, ia64-tdep.o): Ditto.
(rs6000-tdep.o, stabsread.o, valarith.o): Ditto.
(values.o, valprint.o, arm-linux-tdep.o): Ditto.
(alpha-tdep.o, ax_h, parse.o, top.o, value_h): Ditto.
(parser_defs_h): Ditto.
(expression_h): Add $(doublest_h) and $(symtab_h).
Diffstat (limited to 'gdb/findvar.c')
-rw-r--r-- | gdb/findvar.c | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/gdb/findvar.c b/gdb/findvar.c index 28a8ce05a99..0ba939284a1 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -288,102 +288,6 @@ store_typed_address (void *buf, struct type *type, CORE_ADDR addr) - -/* Extract a floating-point number from a target-order byte-stream at ADDR. - Returns the value as type DOUBLEST. - - If the host and target formats agree, we just copy the raw data into the - appropriate type of variable and return, letting the host increase precision - as necessary. Otherwise, we call the conversion routine and let it do the - dirty work. */ - -DOUBLEST -extract_floating (void *addr, int len) -{ - DOUBLEST dretval; - - if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT) - { - if (HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT) - { - float retval; - - memcpy (&retval, addr, sizeof (retval)); - return retval; - } - else - floatformat_to_doublest (TARGET_FLOAT_FORMAT, addr, &dretval); - } - else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT) - { - if (HOST_DOUBLE_FORMAT == TARGET_DOUBLE_FORMAT) - { - double retval; - - memcpy (&retval, addr, sizeof (retval)); - return retval; - } - else - floatformat_to_doublest (TARGET_DOUBLE_FORMAT, addr, &dretval); - } - else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT) - { - if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT) - { - DOUBLEST retval; - - memcpy (&retval, addr, sizeof (retval)); - return retval; - } - else - floatformat_to_doublest (TARGET_LONG_DOUBLE_FORMAT, addr, &dretval); - } - else - { - error ("Can't deal with a floating point number of %d bytes.", len); - } - - return dretval; -} - -void -store_floating (void *addr, int len, DOUBLEST val) -{ - if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT) - { - if (HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT) - { - float floatval = val; - - memcpy (addr, &floatval, sizeof (floatval)); - } - else - floatformat_from_doublest (TARGET_FLOAT_FORMAT, &val, addr); - } - else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT) - { - if (HOST_DOUBLE_FORMAT == TARGET_DOUBLE_FORMAT) - { - double doubleval = val; - - memcpy (addr, &doubleval, sizeof (doubleval)); - } - else - floatformat_from_doublest (TARGET_DOUBLE_FORMAT, &val, addr); - } - else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT) - { - if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT) - memcpy (addr, &val, sizeof (val)); - else - floatformat_from_doublest (TARGET_LONG_DOUBLE_FORMAT, &val, addr); - } - else - { - error ("Can't deal with a floating point number of %d bytes.", len); - } -} - /* Return a `value' with the contents of register REGNUM in its virtual format, with the type specified by REGISTER_VIRTUAL_TYPE. |