diff options
author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2017-11-06 16:02:33 +0100 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2017-11-06 16:02:33 +0100 |
commit | b07e9c466ed24af614090ac42d6730a291608f69 (patch) | |
tree | cd800a1298a4333f68ab971b516017362029fa0b /gdb/value.c | |
parent | 3b2ca8248cae742c00cb4e94138edf1403d43d47 (diff) | |
download | gdb-b07e9c466ed24af614090ac42d6730a291608f69.zip gdb-b07e9c466ed24af614090ac42d6730a291608f69.tar.gz gdb-b07e9c466ed24af614090ac42d6730a291608f69.tar.bz2 |
Target FP: Remove unused floating-point routines
This patch removes the following routines, which now have no remaining
users in GDB:
- extract_typed_floating
- store_typed_floating
- convert_typed_floating
- decimal_from_doublest
- decimal_to_doublest
- value_as_double
- unpack_double
- value_from_double
- value_from_decfloat
This completes removal of DOUBLEST from all files except doublest.{c,h}
and target-float.c.
gdb/ChangeLog:
2017-11-06 Ulrich Weigand <uweigand@de.ibm.com>
* doublest.c: Do not include "gdbtypes.h".
(extract_typed_floating): Remove.
(store_typed_floating): Remove.
(convert_typed_floating): Remove.
* doublest.h (struct type): Remove.
(DOUBLEST_PRINT_FORMAT): Remove.
(DOUBLEST_SCAN_FORMAT): Remove.
(extract_typed_floating): Remove.
(store_typed_floating): Remove.
(convert_typed_floating): Remove.
* dfp.c (decimal_from_doublest): Remove.
(decimal_to_doublest): Remove.
* dfp.h: Do not include "doublest.h".
(decimal_from_doublest): Remove.
(decimal_to_doublest): Remove.
* value.c: Do not include "doublest.h" and "dfp.h".
(value_as_double): Remove.
(unpack_double): Remove.
(value_from_double): Remove.
(value_from_decfloat): Remove.
* value.h: Do not include "doublest.h".
(value_as_double): Remove.
(unpack_double): Remove.
(value_from_double): Remove.
(value_from_decfloat): Remove.
Diffstat (limited to 'gdb/value.c')
-rw-r--r-- | gdb/value.c | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/gdb/value.c b/gdb/value.c index bc21113..8fd391e 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -28,10 +28,8 @@ #include "target.h" #include "language.h" #include "demangle.h" -#include "doublest.h" #include "regcache.h" #include "block.h" -#include "dfp.h" #include "target-float.h" #include "objfiles.h" #include "valprint.h" @@ -2764,18 +2762,6 @@ value_as_long (struct value *val) return unpack_long (value_type (val), value_contents (val)); } -DOUBLEST -value_as_double (struct value *val) -{ - DOUBLEST foo; - int inv; - - foo = unpack_double (value_type (val), value_contents (val), &inv); - if (inv) - error (_("Invalid floating value found in program.")); - return foo; -} - /* Extract a value as a C pointer. Does not deallocate the value. Note that val's type may not actually be a pointer; value_as_long handles all the cases. */ @@ -2938,49 +2924,6 @@ unpack_long (struct type *type, const gdb_byte *valaddr) return 0; /* Placate lint. */ } -/* Return a double value from the specified type and address. - INVP points to an int which is set to 0 for valid value, - 1 for invalid value (bad float format). In either case, - the returned double is OK to use. Argument is in target - format, result is in host format. */ - -DOUBLEST -unpack_double (struct type *type, const gdb_byte *valaddr, int *invp) -{ - enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); - enum type_code code; - int len; - int nosign; - - *invp = 0; /* Assume valid. */ - type = check_typedef (type); - code = TYPE_CODE (type); - len = TYPE_LENGTH (type); - nosign = TYPE_UNSIGNED (type); - if (code == TYPE_CODE_FLT) - { - if (!target_float_is_valid (valaddr, type)) - { - *invp = 1; - return 0.0; - } - - return extract_typed_floating (valaddr, type); - } - else if (code == TYPE_CODE_DECFLOAT) - return decimal_to_doublest (valaddr, len, byte_order); - else if (nosign) - { - /* Unsigned -- be sure we compensate for signed LONGEST. */ - return (ULONGEST) unpack_long (type, valaddr); - } - else - { - /* Signed -- we are OK with unpack_long. */ - return unpack_long (type, valaddr); - } -} - /* Unpack raw data (copied from debugee, target byte order) at VALADDR as a CORE_ADDR, assuming the raw data is described by type TYPE. We don't assume any alignment for the raw data. Return value is in @@ -3693,32 +3636,6 @@ value_from_contents (struct type *type, const gdb_byte *contents) return result; } -struct value * -value_from_double (struct type *type, DOUBLEST num) -{ - struct value *val = allocate_value (type); - struct type *base_type = check_typedef (type); - enum type_code code = TYPE_CODE (base_type); - - if (code == TYPE_CODE_FLT) - { - store_typed_floating (value_contents_raw (val), base_type, num); - } - else - error (_("Unexpected type encountered for floating constant.")); - - return val; -} - -struct value * -value_from_decfloat (struct type *type, const gdb_byte *dec) -{ - struct value *val = allocate_value (type); - - memcpy (value_contents_raw (val), dec, TYPE_LENGTH (type)); - return val; -} - /* Extract a value from the history file. Input will be of the form $digits or $$digits. See block comment above 'write_dollar_variable' for details. */ |