[RFA] arm_extract_return_value, big-endian

Michael Snyder
2002-11-06T21:30:17Z

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

[This doesn't seem to have gone out. Excuse me if it appears twice]

One of you arm-savvy guys check me out on this:
it seems logical, and it fixes two fails in callfuncs with -mbig-endian.

Michael

[-- Attachment #2: arm.patch --]
[-- Type: text/plain, Size: 848 bytes --]

2002-11-05 Michael Snyder <msnyder@redhat.com>

* arm-tdep.c (arm_extract_return_value): Handle offset of
small types on big-endian machines.

Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.74
diff -p -r1.74 arm-tdep.c
*** arm-tdep.c 1 Nov 2002 21:21:49 -0000 1.74
--- arm-tdep.c 6 Nov 2002 01:54:36 -0000
*************** arm_extract_return_value (struct type *t
*** 2274,2279 ****
--- 2274,2284 ----
break;
}
}
+ else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+ memcpy (valbuf,
+ &regbuf[REGISTER_BYTE (ARM_A1_REGNUM)]
+ + (REGISTER_RAW_SIZE (ARM_A1_REGNUM) - TYPE_LENGTH (type)),
+ TYPE_LENGTH (type));
else
memcpy (valbuf, &regbuf[REGISTER_BYTE (ARM_A1_REGNUM)],
TYPE_LENGTH (type));