This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: [PATCH]: Make Sparc Target Multi-Arch
- To: "Peter.Schauer" <Peter dot Schauer at regent dot e-technik dot tu-muenchen dot de>
- Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Tue, 02 May 2000 10:11:34 -0700
- CC: gdb-patches at sourceware dot cygnus dot com, taylor at cygnus dot com
- Organization: Cygnus Solutions
- References: <200005021109.NAA12981@reisser.regent.e-technik.tu-muenchen.de>
- Reply-To: msnyder at cygnus dot com
Peter.Schauer wrote:
>
> > I've also included in this patch the ability to do call-dummies
> > using the AT_ENTRY_POINT method, rather than pushing instructions
> > onto the stack (since that isn't allowed in 64-bit Solaris).
>
> Using AT_ENTRY_POINT will return bad results when calling a Sun cc compiled
> function that returns a struct from within GDB.
>
> Sun cc generates code which checks the expected structure size against
> the passed structure size (in the extra word after the call) and does not
> copy to the result structure if the sizes don't match.
> Below is the disassembly of a function returning a structure with size 16.
Yuck! Well, I can't use ON_STACK, because (a) the stack section
is protected against execution in Solaris/Sparc64, and (b) it's
too far from the text section for an ordinary jump/call.
What if I write the return struct size to the entry point address,
following the trap instruction, and remove it when finished
(like the trap instruction)?