This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Patch for mips_o64_return_value to fix calling functions by hand (additional patch)
- From: Fred Fish <fnf at specifix dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 2 May 2006 16:30:15 -0400
- Subject: Re: [RFA] Patch for mips_o64_return_value to fix calling functions by hand (additional patch)
- References: <200604271004.44938.fnf@specifix.com>
- Reply-to: fnf at specifix dot com
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<n>; call 1 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 2 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 3 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 4 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 5 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 6 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 7 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 9 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 10 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 11 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 12 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 13 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 14 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 15 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 17 structs-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 1 structs-ts
< FAIL: gdb.base/structs.exp: p/c L<n>; call 2 structs-ts
< FAIL: gdb.base/structs.exp: p/c L<n>; call 3 structs-ts
< FAIL: gdb.base/structs.exp: p/c L<n>; call 5 structs-ts
< FAIL: gdb.base/structs.exp: p/c L<n>; call 1 structs-ti
< FAIL: gdb.base/structs.exp: p/c L<n>; call 3 structs-ti
< FAIL: gdb.base/structs.exp: p/c L<n>; call 1 structs-tl
< FAIL: gdb.base/structs.exp: p/c L<n>; call 3 structs-tl
< FAIL: gdb.base/structs.exp: p/c L<n>; call 1 structs-tf
< FAIL: gdb.base/structs.exp: p/c L<n>; call 3 structs-tf
< FAIL: gdb.base/structs.exp: p/c L<n>; call 2 structs-ts-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 3 structs-ts-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 4 structs-ts-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 5 structs-ts-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 8 structs-ts-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 6 structs-ti-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 6 structs-tl-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 6 structs-tf-tc
< FAIL: gdb.base/structs.exp: p/c L<n>; call 2 structs-tc-ts
< FAIL: gdb.base/structs.exp: p/c L<n>; call 3 structs-tc-ts
< FAIL: gdb.base/structs.exp: p/c L<n>; call 5 structs-tc-ts
< FAIL: gdb.base/structs.exp: p/c L<n>; call 6 structs-tc-ts
< FAIL: gdb.base/structs.exp: p/c L<n>; call 3 structs-tc-ti
< FAIL: gdb.base/structs.exp: p/c L<n>; call 3 structs-tc-tl
< FAIL: gdb.base/structs.exp: p/c L<n>; call 3 structs-tc-tf
-Fred
2006-05-02 Fred Fish <fnf@specifix.com>
* 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))