This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH]: Make Sparc Target Multi-Arch


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]