This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Fix ARM big-endian struct arg passing
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 19 Jun 2007 18:11:21 +0000 (UTC)
- Subject: Fix ARM big-endian struct arg passing
This patch fixes GDB incorrectly aligning part-register arguments on
big-endian ARM. It changes the following tests from FAIL to PASS in
testing with a cross to arm-linux-gnueabi (big-endian multilib); OK to
commit?
gdb.base/structs.exp: p/c L<n>; call 1 structs-tc
gdb.base/structs.exp: p/c L<n>; call 1 structs-ts
gdb.base/structs.exp: p/c L<n>; call 10 structs-tc
gdb.base/structs.exp: p/c L<n>; call 11 structs-tc
gdb.base/structs.exp: p/c L<n>; call 13 structs-tc
gdb.base/structs.exp: p/c L<n>; call 14 structs-tc
gdb.base/structs.exp: p/c L<n>; call 15 structs-tc
gdb.base/structs.exp: p/c L<n>; call 2 structs-tc
gdb.base/structs.exp: p/c L<n>; call 3 structs-tc
gdb.base/structs.exp: p/c L<n>; call 3 structs-tc-ts
gdb.base/structs.exp: p/c L<n>; call 3 structs-ts
gdb.base/structs.exp: p/c L<n>; call 4 structs-ts-tc
gdb.base/structs.exp: p/c L<n>; call 5 structs-tc
gdb.base/structs.exp: p/c L<n>; call 5 structs-tc-ts
gdb.base/structs.exp: p/c L<n>; call 5 structs-ts
gdb.base/structs.exp: p/c L<n>; call 5 structs-ts-tc
gdb.base/structs.exp: p/c L<n>; call 6 structs-tc
gdb.base/structs.exp: p/c L<n>; call 7 structs-tc
gdb.base/structs.exp: p/c L<n>; call 8 structs-ts-tc
gdb.base/structs.exp: p/c L<n>; call 9 structs-tc
2007-06-19 Joseph Myers <joseph@codesourcery.com>
* arm-tdep.c (arm_push_dummy_call): Correct padding of partial
registers for big-endian.
Index: arm-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/arm-tdep.c,v
retrieving revision 1.238
diff -u -r1.238 arm-tdep.c
--- arm-tdep.c 18 Jun 2007 18:58:13 -0000 1.238
+++ arm-tdep.c 19 Jun 2007 17:26:17 -0000
@@ -1289,6 +1289,8 @@
/* The argument is being passed in a general purpose
register. */
CORE_ADDR regval = extract_unsigned_integer (val, partial_len);
+ if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ regval <<= (INT_REGISTER_SIZE - partial_len) * 8;
if (arm_debug)
fprintf_unfiltered (gdb_stdlog, "arg %d in %s = 0x%s\n",
argnum,
--
Joseph S. Myers
joseph@codesourcery.com