[RFC 1/4] - Only longjmp if going outer.

Pedro Alves pedro@codesourcery.com
Wed Apr 9 14:57:00 GMT 2008


Here's the patch that implements the decision to follow the longjmp, or if
the current step-resume breakpoint is to be kept.

This adds a new parameter to the gdbarch_get_longjmp_target to also
extract the SP out of it.  Then, whenever we're setting a step-resume
breakpoint, we store the current SP in it.  If a longjmp is hit, we
extract the PC and SP out of the jmp_buf, and compare the SP with
what was stored in the step-resume breakpoint.  If the longjmp would
take us outer frame we follow it, otherwise, we just keep going as
if we didn't see the longjmp.

Updating all targets will be done in patch 3.

-- 
Pedro Alves
-------------- next part --------------
A non-text attachment was scrubbed...
Name: longjmp_rewrite_outer.diff
Type: text/x-diff
Size: 7785 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080409/041a021e/attachment.bin>


More information about the Gdb-patches mailing list