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


Phil Muldoon <pmuldoon@redhat.com> writes:

>> 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.

In libstdc++ set_terminate is implemented as

  std::terminate_handler old = __terminate_handler;
  __terminate_handler = func;
  return old;

so it just sets __terminate_handler.  Setting a breakpoint on the
value of __terminate_handler is more-or-less equivalent to calling
set_terminate yourself.  If you make sure that the exception unwind
code can't unwind past the gdb-invented inferior function frame, then
the inferior won't be terminated.

Ian


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