aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Alexander <marka@cygnus>1997-03-24 00:29:12 +0000
committerMark Alexander <marka@cygnus>1997-03-24 00:29:12 +0000
commit87ee36023cfe296160c775df0d0e76aea205cbde (patch)
tree3e191b8bfa85253abb057c5ad390e2951c771adb
parenta9b9b4071f3a53f0ee1dc929ceffb6680e8dff32 (diff)
downloadgdb-87ee36023cfe296160c775df0d0e76aea205cbde.zip
gdb-87ee36023cfe296160c775df0d0e76aea205cbde.tar.gz
gdb-87ee36023cfe296160c775df0d0e76aea205cbde.tar.bz2
Fixes from Peter Schauer:
* config/mips/tm-mips.h (REGISTER_CONVERT_TO_TYPE, REGISTER_CONVERT_FROM_TYPE): Swap words if target, not host, is big-endian and if registers are 32 bits. * mips-tdep.c (mips_print_register, mips_extract_return_value, mips_store_return_value): Fix floating-point word-order problems on little-endian targets introduced by changes of Mar 21.
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/config/mips/tm-mips.h20
2 files changed, 22 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d9c3c2d..e25c25d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,13 @@
+Sun Mar 23 16:19:20 1997 Mark Alexander <marka@cygnus.com>
+
+Fixes from Peter Schauer:
+ * config/mips/tm-mips.h (REGISTER_CONVERT_TO_TYPE,
+ REGISTER_CONVERT_FROM_TYPE): Swap words if target, not host,
+ is big-endian and if registers are 32 bits.
+ * mips-tdep.c (mips_print_register, mips_extract_return_value,
+ mips_store_return_value): Fix floating-point word-order problems on
+ little-endian targets introduced by changes of Mar 21.
+
Sun Mar 23 15:43:27 1997 Stan Shebs <shebs@andros.cygnus.com>
* remote.c (target_resume_hook, target_wait_loop_hook): New
diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h
index aa595f5..64a26b5 100644
--- a/gdb/config/mips/tm-mips.h
+++ b/gdb/config/mips/tm-mips.h
@@ -265,28 +265,32 @@ extern void mips_do_registers_info PARAMS ((int, int));
? builtin_type_float : builtin_type_int)
#endif
-#if HOST_BYTE_ORDER == BIG_ENDIAN
/* All mips targets store doubles in a register pair with the least
significant register in the lower numbered register.
- If the host is big endian, double register values need conversion between
- memory and register formats. */
+ If the target is big endian, double register values need conversion
+ between memory and register formats. */
#define REGISTER_CONVERT_TO_TYPE(n, type, buffer) \
- do {if ((n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 && \
- TYPE_CODE(type) == TYPE_CODE_FLT && TYPE_LENGTH(type) == 8) { \
+ do {if (TARGET_BYTE_ORDER == BIG_ENDIAN \
+ && REGISTER_RAW_SIZE (n) == 4 \
+ && (n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 \
+ && TYPE_CODE(type) == TYPE_CODE_FLT \
+ && TYPE_LENGTH(type) == 8) { \
char __temp[4]; \
memcpy (__temp, ((char *)(buffer))+4, 4); \
memcpy (((char *)(buffer))+4, (buffer), 4); \
memcpy (((char *)(buffer)), __temp, 4); }} while (0)
#define REGISTER_CONVERT_FROM_TYPE(n, type, buffer) \
- do {if ((n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 && \
- TYPE_CODE(type) == TYPE_CODE_FLT && TYPE_LENGTH(type) == 8) { \
+ do {if (TARGET_BYTE_ORDER == BIG_ENDIAN \
+ && REGISTER_RAW_SIZE (n) == 4 \
+ && (n) >= FP0_REGNUM && (n) < FP0_REGNUM + 32 \
+ && TYPE_CODE(type) == TYPE_CODE_FLT \
+ && TYPE_LENGTH(type) == 8) { \
char __temp[4]; \
memcpy (__temp, ((char *)(buffer))+4, 4); \
memcpy (((char *)(buffer))+4, (buffer), 4); \
memcpy (((char *)(buffer)), __temp, 4); }} while (0)
-#endif
/* Store the address of the place in which to copy the structure the
subroutine will return. Handled by mips_push_arguments. */