From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1739 invoked by alias); 2 May 2006 20:29:51 -0000 Received: (qmail 1731 invoked by uid 22791); 2 May 2006 20:29:49 -0000 X-Spam-Check-By: sourceware.org Received: from w099.z064220152.sjc-ca.dsl.cnc.net (HELO duck.specifix.com) (64.220.152.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 02 May 2006 20:29:45 +0000 Received: from [::1] (duck.specifix.com [64.220.152.99]) by duck.specifix.com (Postfix) with ESMTP id 6BE0FFC7B for ; Tue, 2 May 2006 13:29:34 -0700 (PDT) From: Fred Fish Reply-To: fnf@specifix.com To: gdb-patches@sourceware.org Subject: Re: [RFA] Patch for mips_o64_return_value to fix calling functions by hand (additional patch) Date: Tue, 02 May 2006 20:29:00 -0000 User-Agent: KMail/1.9.1 References: <200604271004.44938.fnf@specifix.com> In-Reply-To: <200604271004.44938.fnf@specifix.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_XF8VE9Ht6uS4/jI" Message-Id: <200605021630.15861.fnf@specifix.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00015.txt.bz2 --Boundary-00=_XF8VE9Ht6uS4/jI Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 3192 On Thursday 27 April 2006 10:04, Fred Fish wrote: > I'm doing some work with a mips64-elf toolchain and took a look at why > there are so many gdb testsuite failures. One problem I found is that > calling functions by hand was broken, For mips_o64_push_dummy_call, mips_abi_regsize(gdbarch) always evaluates to 8, and was suppressing a needed left shift of struct and union arguments passed big endian. Attached is an additional patch which fixes the following FAILs: < FAIL: gdb.base/call-rt-st.exp: print print_bit_flags_char(*cflags) < FAIL: gdb.base/call-rt-st.exp: print print_bit_flags_short(*sflags) < FAIL: gdb.base/call-rt-st.exp: print print_bit_flags(*flags) < FAIL: gdb.base/call-rt-st.exp: print print_three_chars(*three_char) < FAIL: gdb.base/call-rt-st.exp: print print_five_chars(*five_char) < FAIL: gdb.base/structs.exp: p/c L; call 1 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 2 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 3 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 4 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 5 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 6 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 7 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 9 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 10 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 11 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 12 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 13 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 14 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 15 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 17 structs-tc < FAIL: gdb.base/structs.exp: p/c L; call 1 structs-ts < FAIL: gdb.base/structs.exp: p/c L; call 2 structs-ts < FAIL: gdb.base/structs.exp: p/c L; call 3 structs-ts < FAIL: gdb.base/structs.exp: p/c L; call 5 structs-ts < FAIL: gdb.base/structs.exp: p/c L; call 1 structs-ti < FAIL: gdb.base/structs.exp: p/c L; call 3 structs-ti < FAIL: gdb.base/structs.exp: p/c L; call 1 structs-tl < FAIL: gdb.base/structs.exp: p/c L; call 3 structs-tl < FAIL: gdb.base/structs.exp: p/c L; call 1 structs-tf < FAIL: gdb.base/structs.exp: p/c L; call 3 structs-tf < FAIL: gdb.base/structs.exp: p/c L; call 2 structs-ts-tc < FAIL: gdb.base/structs.exp: p/c L; call 3 structs-ts-tc < FAIL: gdb.base/structs.exp: p/c L; call 4 structs-ts-tc < FAIL: gdb.base/structs.exp: p/c L; call 5 structs-ts-tc < FAIL: gdb.base/structs.exp: p/c L; call 8 structs-ts-tc < FAIL: gdb.base/structs.exp: p/c L; call 6 structs-ti-tc < FAIL: gdb.base/structs.exp: p/c L; call 6 structs-tl-tc < FAIL: gdb.base/structs.exp: p/c L; call 6 structs-tf-tc < FAIL: gdb.base/structs.exp: p/c L; call 2 structs-tc-ts < FAIL: gdb.base/structs.exp: p/c L; call 3 structs-tc-ts < FAIL: gdb.base/structs.exp: p/c L; call 5 structs-tc-ts < FAIL: gdb.base/structs.exp: p/c L; call 6 structs-tc-ts < FAIL: gdb.base/structs.exp: p/c L; call 3 structs-tc-ti < FAIL: gdb.base/structs.exp: p/c L; call 3 structs-tc-tl < FAIL: gdb.base/structs.exp: p/c L; call 3 structs-tc-tf -Fred --Boundary-00=_XF8VE9Ht6uS4/jI Content-Type: text/x-diff; charset="utf-8"; name="struct-union-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="struct-union-fix.patch" Content-length: 1518 2006-05-02 Fred Fish * mips-tdep.c (mips_o64_push_dummy_call): Left shift big endian structs or unions independent of ABI register size. Index: mips-tdep.c =================================================================== RCS file: /cvsroots/latest/src/gdb/gdb/mips-tdep.c,v retrieving revision 1.1.1.4 diff -c -p -r1.1.1.4 mips-tdep.c *** mips-tdep.c 22 Apr 2006 17:31:07 -0000 1.1.1.4 --- mips-tdep.c 2 May 2006 18:19:01 -0000 *************** mips_o64_push_dummy_call (struct gdbarch *** 3721,3728 **** It does not seem to be necessary to do the same for integral types. - Also don't do this adjustment on O64 binaries. - cagney/2001-07-23: gdb/179: Also, GCC, when outputting LE O32 with sizeof (struct) < mips_abi_regsize(), generates a left shift as --- 3721,3726 ---- *************** mips_o64_push_dummy_call (struct gdbarch *** 3737,3744 **** identified as such and GDB gets tweaked accordingly. */ ! if (mips_abi_regsize (gdbarch) < 8 ! && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && partial_len < mips_abi_regsize (gdbarch) && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) --- 3735,3741 ---- identified as such and GDB gets tweaked accordingly. */ ! if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && partial_len < mips_abi_regsize (gdbarch) && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)) --Boundary-00=_XF8VE9Ht6uS4/jI--