diff options
author | Daniel Jacobowitz <drow@false.org> | 2007-01-29 17:31:06 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2007-01-29 17:31:06 +0000 |
commit | 8da61cc40ac287bc30919c8648c0f7addc515008 (patch) | |
tree | eb58ca81d7519243507ccb6362816ede4a492163 /gdb/doublest.c | |
parent | cecb04b70c2a8d2f5ea53524435ccd59d6e65bbb (diff) | |
download | gdb-8da61cc40ac287bc30919c8648c0f7addc515008.zip gdb-8da61cc40ac287bc30919c8648c0f7addc515008.tar.gz gdb-8da61cc40ac287bc30919c8648c0f7addc515008.tar.bz2 |
* doublest.c (floatformat_from_length): Use the right element from
gdbarch floatformats.
(floatformat_from_type, extract_typed_floating)
(store_typed_floating): Likewise.
* doublest.h: Remove declarations for undefined floatformat arrays.
* gdbarch.sh (float_format, double_format, long_double_format): Change
to pairs.
(pformat): Update for pairs.
* gdbarch.c, gdbarch.h: Regenerated.
* gdbtypes.c (floatformats_ieee_single, floatformats_ieee_double)
(floatformats_ieee_double_littlebyte_bigword)
(floatformats_i387_ext, floatformats_m68881_ext, floatformats_arm_ext)
(floatformats_ia64_spill, floatformats_ia64_quad, floatformats_vax_f)
(floatformats_vax_d): New variables.
(builtin_type_ieee_single, builtin_type_ieee_double)
(builtin_type_arm_ext, builtin_type_ia64_spill)
(builtin_type_ia64_quad): Replace arrays with individual types.
(builtin_type_ieee_single_big, builtin_type_ieee_single_little)
(builtin_type_ieee_double_big, builtin_type_ieee_double_little)
(builtin_type_ieee_double_littlebyte_bigword, builtin_type_i960_ext)
(builtin_type_m88110_ext, builtin_type_m88110_harris_ext)
(builtin_type_arm_ext_big, builtin_type_arm_ext_littlebyte_bigword)
(builtin_type_ia64_spill_big, builtin_type_ia64_spill_little)
(builtin_type_ia64_quad_big, builtin_type_ia64_quad_little): Delete
unused and endian-specific types.
(recursive_dump_type): Update for floatformat pairs.
(build_flt): Move higher. Handle bit == -1. Take a floatformat pair.
(build_gdbtypes): Use build_flt.
(_initialize_gdbtypes): Update set of initialized types.
* gdbtypes.h: Update declarations to match gdbtypes.c.
(struct main_type): Store a pointer to two floatformats.
* arch-utils.c (default_float_format, default_double_format): Delete.
* arch-utils.h (default_float_format, default_double_format): Delete.
* arm-tdep.c, avr-tdep.c, hppa-tdep.c, hppabsd-tdep.c, i386-tdep.c,
ia64-tdep.c, iq2000-tdep.c, m68k-tdep.c, m88k-tdep.c,
mips-linux-tdep.c, mips-tdep.c, mt-tdep.c, ppcobsd-tdep.c,
sparc-linux-tdep.c, sparc-tdep.c, sparcnbsd-tdep.c, spu-tdep.c,
vax-tdep.c, alpha-tdep.c, ppc-sysv-tdep.c: Update.
Diffstat (limited to 'gdb/doublest.c')
-rw-r--r-- | gdb/doublest.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gdb/doublest.c b/gdb/doublest.c index 0f92fdf..3b640f5 100644 --- a/gdb/doublest.c +++ b/gdb/doublest.c @@ -689,19 +689,19 @@ floatformat_from_length (int len) { const struct floatformat *format; if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT) - format = TARGET_FLOAT_FORMAT; + format = TARGET_FLOAT_FORMAT[TARGET_BYTE_ORDER]; else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT) - format = TARGET_DOUBLE_FORMAT; + format = TARGET_DOUBLE_FORMAT[TARGET_BYTE_ORDER]; else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT) - format = TARGET_LONG_DOUBLE_FORMAT; + format = TARGET_LONG_DOUBLE_FORMAT[TARGET_BYTE_ORDER]; /* On i386 the 'long double' type takes 96 bits, while the real number of used bits is only 80, both in processor and in memory. The code below accepts the real bit size. */ else if ((TARGET_LONG_DOUBLE_FORMAT != NULL) && (len * TARGET_CHAR_BIT == - TARGET_LONG_DOUBLE_FORMAT->totalsize)) - format = TARGET_LONG_DOUBLE_FORMAT; + TARGET_LONG_DOUBLE_FORMAT[0]->totalsize)) + format = TARGET_LONG_DOUBLE_FORMAT[TARGET_BYTE_ORDER]; else format = NULL; if (format == NULL) @@ -715,7 +715,7 @@ floatformat_from_type (const struct type *type) { gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT); if (TYPE_FLOATFORMAT (type) != NULL) - return TYPE_FLOATFORMAT (type); + return TYPE_FLOATFORMAT (type)[TARGET_BYTE_ORDER]; else return floatformat_from_length (TYPE_LENGTH (type)); } @@ -776,7 +776,8 @@ extract_typed_floating (const void *addr, const struct type *type) 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); + floatformat_to_doublest (TYPE_FLOATFORMAT (type)[TARGET_BYTE_ORDER], + addr, &retval); return retval; } @@ -813,7 +814,8 @@ store_typed_floating (void *addr, const struct type *type, DOUBLEST val) 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); + floatformat_from_doublest (TYPE_FLOATFORMAT (type)[TARGET_BYTE_ORDER], + &val, addr); } /* Convert a floating-point number of type FROM_TYPE from a |