Inferior function calls and out-of-frame exception handlers

Ian Lance Taylor iant@google.com
Fri Aug 15 14:01:00 GMT 2008


Phil Muldoon <pmuldoon@redhat.com> writes:

> That being said, I'm a little at a loss on how this can fixed. The
> unwinder and exception raising mechanisms are working as designed
> and the inferior function frame is being correctly assembled for the
> command. I was pondering catching the exception with a GDB supplied
> implementation-specific handler for the purposes of the inferior
> function call. But not sure if this is even possible. Suggestions?

One possibility: have gdb start by calling set_terminate in the
inferior passing a magic address.  Set a breakpoint on that address.
Make sure that the exception handler can not trace the stack past the
inferior function frame.  If an exception occurs, the new breakpoint
will be hit.  Call set_terminate again after the function call.

When using libstdc++, you don't need to call set_terminate, you can
just set a breakpoint on the value of the global variable
__terminate_handler.

Ian



More information about the Archer mailing list