Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Fred Fish <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	[thread overview]
Message-ID: <200605021630.15861.fnf@specifix.com> (raw)
In-Reply-To: <200604271004.44938.fnf@specifix.com>

[-- Attachment #1: Type: text/plain, Size: 3192 bytes --]

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


[-- Attachment #2: struct-union-fix.patch --]
[-- Type: text/x-diff, Size: 1518 bytes --]

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))

  reply	other threads:[~2006-05-02 20:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-27 14:04 [RFA] Patch for mips_o64_return_value to fix calling functions by hand Fred Fish
2006-05-02 20:29 ` Fred Fish [this message]
2006-05-05 17:11   ` [RFA] Patch for mips_o64_return_value to fix calling functions by hand (additional patch) Daniel Jacobowitz
2006-05-05 18:06     ` [commit] " Fred Fish
2006-05-05 17:13 ` [RFA] Patch for mips_o64_return_value to fix calling functions by hand Daniel Jacobowitz
2006-05-05 17:55   ` [commit] " Fred Fish

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=200605021630.15861.fnf@specifix.com \
    --to=fnf@specifix.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