This is the mail archive of the gdb-patches@sources.redhat.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]
Other format: [Raw text]

Re: [rfa:NetBSD/ppc] Implement signal trampoline unwinder


   From: Jason Thorpe <thorpej@wasabisystems.com>
   Date: Wed, 3 Mar 2004 12:46:40 -0800

   On Mar 3, 2004, at 12:43 PM, Andrew Cagney wrote:

   > Jason, am I correct to assume that the second SC here:
   >
   > (gdb) x/10i $lr
   > 0x7fffefdc:     addi    r3,r1,24
   > 0x7fffefe0:     li      r0,295
   > 0x7fffefe4:     sc

   This is __sigreturn14

   > 0x7fffefe8:     li      r0,1
   > 0x7fffefec:     sc

   and this is exit (process croaks if sigreturn failed).

Andrew, 

This is the usual pattern.  A sigreturn system call followed by an
exit system call.  There may be several versions of the sigreturn
system call in an OS (besides __sigreturn14, NetBSD also has an older
sigreturn system call).  Before the system call there may be some code
that does the call to the signal handler.  If all instructions have
the same length (as is the case on SPARC, and appears to be the case
on PPC) it may be enough to check for the sigreturn system call
(i.e. li r0,295; sc).

Mark


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