[PATCH] ARM: Add SystemTap probes to longjmp and setjmp.

Roland McGrath roland@hack.frob.com
Tue Jan 28 22:03:00 GMT 2014


> On Mon, 27 Jan 2014, Will Newton wrote:
> 
> > @@ -50,6 +48,11 @@ ENTRY (__longjmp)
> >  	ldr	sp, [ip], #4
> >  	ldr	lr, [ip], #4
> >  #endif
> > +	/* longjmp probe expects longjmp first argument (4@r0), second
> > +	   argument (-4@r1), and target address (4@r14), respectively.  */
> > +	LIBC_PROBE (longjmp, 3, 4@r0, -4@r1, 4@r14)
> 
> The discussion on libc-alpha said this probe should be before unwinding; 
> shouldn't that mean before sp and lr are restored, so that at probe time 
> it's still possible to unwind through the caller of longjmp?

Yes, the longjmp probe is conceptually "at entry to longjmp".  So it needs
to be just far enough in that you have demangled the pointers to make them
available as the probe's arguments.  The longmp_target probe is the one
that should be as late as possible, so all the registers except the PC
itself (or as close as the particular machine's implementation makes
possible) reflect the state being restored.



More information about the Libc-ports mailing list