This is the mail archive of the archer@sourceware.org mailing list for the Archer 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: Inferior function calls and out-of-frame exception handlers


Ian Lance Taylor wrote:
Phil Muldoon <pmuldoon@redhat.com> writes:

Thanks for this, and apologies for the lateness in reply. I thought I had replied before I left for holidays.


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.

That's a pretty neat idea. So call set_terminate() to point to a GDB defined landing-pad and handle the exception for the inferior call, and restore all the gates after the fact. I'll research how to do this and thanks for the pointers (pun perhaps intended ;)


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.

How will this actually stop the inferior being terminated after the breakpoint though? I'm still bending my thoughts around this concept.


Regards

Phil



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