aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-tdep.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1995-08-01 09:20:05 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1995-08-01 09:20:05 +0000
commit92a6d6005325167e4e33d2c5d5d9e4d6d98de91d (patch)
tree2068c221942229e8001952e5cc4e562daefe8b29 /gdb/mips-tdep.c
parent4f2f30116bbef513af63b7b45bd7ef13bd7b4673 (diff)
downloadgdb-92a6d6005325167e4e33d2c5d5d9e4d6d98de91d.zip
gdb-92a6d6005325167e4e33d2c5d5d9e4d6d98de91d.tar.gz
gdb-92a6d6005325167e4e33d2c5d5d9e4d6d98de91d.tar.bz2
* mips-tdep.c (mips_extract_return_value): Fix returning of
values whose length is less than the register size for big endian targets. * alpha-tdep.c (alpha_extract_return_value, alpha_store_return_value): Use alpha_convert_register_to_* to handle functions returning "float" correctly.
Diffstat (limited to 'gdb/mips-tdep.c')
-rw-r--r--gdb/mips-tdep.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index c6ec5f9..2bd7127 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -1227,6 +1227,7 @@ mips_extract_return_value (valtype, regbuf, valbuf)
char *valbuf;
{
int regnum;
+ int offset = 0;
regnum = 2;
if (TYPE_CODE (valtype) == TYPE_CODE_FLT
@@ -1234,7 +1235,13 @@ mips_extract_return_value (valtype, regbuf, valbuf)
|| (mips_fpu == MIPS_FPU_SINGLE && TYPE_LENGTH (valtype) <= 4)))
regnum = FP0_REGNUM;
- memcpy (valbuf, regbuf + REGISTER_BYTE (regnum), TYPE_LENGTH (valtype));
+ if (TARGET_BYTE_ORDER == BIG_ENDIAN
+ && TYPE_CODE (valtype) != TYPE_CODE_FLT
+ && TYPE_LENGTH (valtype) < REGISTER_RAW_SIZE (regnum))
+ offset = REGISTER_RAW_SIZE (regnum) - TYPE_LENGTH (valtype);
+
+ memcpy (valbuf, regbuf + REGISTER_BYTE (regnum) + offset,
+ TYPE_LENGTH (valtype));
#ifdef REGISTER_CONVERT_TO_TYPE
REGISTER_CONVERT_TO_TYPE(regnum, valtype, valbuf);
#endif