Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Fix ARM big-endian struct arg passing
Date: Tue, 19 Jun 2007 18:11:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.0706191808440.15926@digraph.polyomino.org.uk> (raw)

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


             reply	other threads:[~2007-06-19 18:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-19 18:11 Joseph S. Myers [this message]
2007-06-19 22:42 ` Richard Earnshaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0706191808440.15926@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox