From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5702 invoked by alias); 19 Jun 2007 18:11:28 -0000 Received: (qmail 5693 invoked by uid 22791); 19 Jun 2007 18:11:27 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 19 Jun 2007 18:11:24 +0000 Received: (qmail 15796 invoked from network); 19 Jun 2007 18:11:22 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 19 Jun 2007 18:11:22 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.63) (envelope-from ) id 1I0iAj-0004UT-Ql for gdb-patches@sourceware.org; Tue, 19 Jun 2007 18:11:21 +0000 Date: Tue, 19 Jun 2007 18:11:00 -0000 From: "Joseph S. Myers" To: gdb-patches@sourceware.org Subject: Fix ARM big-endian struct arg passing Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00374.txt.bz2 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; call 1 structs-tc gdb.base/structs.exp: p/c L; call 1 structs-ts gdb.base/structs.exp: p/c L; call 10 structs-tc gdb.base/structs.exp: p/c L; call 11 structs-tc gdb.base/structs.exp: p/c L; call 13 structs-tc gdb.base/structs.exp: p/c L; call 14 structs-tc gdb.base/structs.exp: p/c L; call 15 structs-tc gdb.base/structs.exp: p/c L; call 2 structs-tc gdb.base/structs.exp: p/c L; call 3 structs-tc gdb.base/structs.exp: p/c L; call 3 structs-tc-ts gdb.base/structs.exp: p/c L; call 3 structs-ts gdb.base/structs.exp: p/c L; call 4 structs-ts-tc gdb.base/structs.exp: p/c L; call 5 structs-tc gdb.base/structs.exp: p/c L; call 5 structs-tc-ts gdb.base/structs.exp: p/c L; call 5 structs-ts gdb.base/structs.exp: p/c L; call 5 structs-ts-tc gdb.base/structs.exp: p/c L; call 6 structs-tc gdb.base/structs.exp: p/c L; call 7 structs-tc gdb.base/structs.exp: p/c L; call 8 structs-ts-tc gdb.base/structs.exp: p/c L; call 9 structs-tc 2007-06-19 Joseph Myers * 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