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: msnyder at cygnus dot com
- Subject: Re: [PATCH]: Make Sparc Target Multi-Arch
- From: "Peter.Schauer" <Peter dot Schauer at regent dot e-technik dot tu-muenchen dot de>
- Date: Tue, 2 May 2000 13:09:10 MET DST
- Cc: gdb-patches at sourceware dot cygnus dot com, taylor at cygnus dot com
> 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.
I don't know if it is worth the trouble, but perhaps GDB could detect the
situation and issue a warning ?
0x10800 <sret>: save %sp, -104, %sp
0x10804 <sret+4>: sethi %hi(0x20800), %l0
0x10808 <sret+8>: or %l0, 0x298, %l0 ! 0x20a98 <gx>
0x1080c <sret+12>: st %l0, [ %fp + -4 ]
0x10810 <sret+16>: b 0x10820 <sret+32>
0x10814 <sret+20>: nop
0x10818 <sret+24>: b 0x10820 <sret+32>
0x1081c <sret+28>: nop
0x10820 <sret+32>: ld [ %fp + -4 ], %l0
0x10824 <sret+36>: mov %l0, %o0
0x10828 <sret+40>: mov 0x10, %o1
0x1082c <sret+44>: call 0xef716a88 <.stret4>
0x10830 <sret+48>: nop
0xef716a88 <.stret4>: ld [ %i7 + 8 ], %o3
0xef716a8c <.stret4+4>: and %o1, 0xfff, %o4
0xef716a90 <.stret4+8>: sethi %hi(0), %o5
0xef716a94 <.stret4+12>: or %o4, %o5, %o5
0xef716a98 <.stret4+16>: cmp %o5, %o3
0xef716a9c <.stret4+20>: bne 0xef716ab8 <.stret4+48>
0xef716aa0 <.stret4+24>: ld [ %fp + 0x40 ], %i0
0xef716aa4 <.stret4+28>: subcc %o1, 4, %o1
0xef716aa8 <.stret4+32>: ld [ %o0 + %o1 ], %o4
0xef716aac <.stret4+36>: bg 0xef716aa4 <.stret4+28>
0xef716ab0 <.stret4+40>: st %o4, [ %i0 + %o1 ]
0xef716ab4 <.stret4+44>: add %i7, 4, %i7
0xef716ab8 <.stret4+48>: ret
0xef716abc <.stret4+52>: restore
--
Peter Schauer pes@regent.e-technik.tu-muenchen.de