diff options
author | Andrew Cagney <cagney@redhat.com> | 2000-06-02 01:59:13 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2000-06-02 01:59:13 +0000 |
commit | f0d4cc9e0ec5ad1533782d32bbf5029b2601828f (patch) | |
tree | 694515271aab5920d4cf655104b857ff03479e1a /gdb/arch-utils.c | |
parent | 1b3739704ea05cca80c0401d4b33ad3dc625e6f4 (diff) | |
download | gdb-f0d4cc9e0ec5ad1533782d32bbf5029b2601828f.zip gdb-f0d4cc9e0ec5ad1533782d32bbf5029b2601828f.tar.gz gdb-f0d4cc9e0ec5ad1533782d32bbf5029b2601828f.tar.bz2 |
Multiarch TARGET_FLOAT_FORMAT, TARGET_DOUBLE_FORMAT,
TARGET_LONG_DOUBLE_FORMAT. Update d10v.
Diffstat (limited to 'gdb/arch-utils.c')
-rw-r--r-- | gdb/arch-utils.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index a012b42..be2433d 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -41,6 +41,8 @@ #include "symfile.h" /* for overlay functions */ #endif +#include "floatformat.h" + /* Convenience macro for allocting typesafe memory. */ #ifndef XMALLOC @@ -163,6 +165,47 @@ core_addr_greaterthan (lhs, rhs) } +/* Helper functions for TARGET_{FLOAT,DOUBLE}_FORMAT */ + +const struct floatformat * +default_float_format (struct gdbarch *gdbarch) +{ +#if GDB_MULTI_ARCH + int byte_order = gdbarch_byte_order (gdbarch); +#else + int byte_order = TARGET_BYTE_ORDER; +#endif + switch (byte_order) + { + case BIG_ENDIAN: + return &floatformat_ieee_single_big; + case LITTLE_ENDIAN: + return &floatformat_ieee_single_little; + default: + internal_error ("default_float_format: bad byte order"); + } +} + + +const struct floatformat * +default_double_format (struct gdbarch *gdbarch) +{ +#if GDB_MULTI_ARCH + int byte_order = gdbarch_byte_order (gdbarch); +#else + int byte_order = TARGET_BYTE_ORDER; +#endif + switch (byte_order) + { + case BIG_ENDIAN: + return &floatformat_ieee_double_big; + case LITTLE_ENDIAN: + return &floatformat_ieee_double_little; + default: + internal_error ("default_double_format: bad byte order"); + } +} + /* */ extern initialize_file_ftype __initialize_gdbarch_utils; |