This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: Inferior function calls and out-of-frame exception handlers
- From: Ian Lance Taylor <iant at google dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: Project Archer <archer at sourceware dot org>
- Date: Mon, 01 Sep 2008 22:35:16 -0700
- Subject: Re: Inferior function calls and out-of-frame exception handlers
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta;t=1220333723; bh=2F95ChHqyIeqkLXqTEAL6G1p+V4=;h=DomainKey-Signature:To:Cc:Subject:References:From:Date: In-Reply-To:Message-ID:User-Agent:MIME-Version:Content-Type; b=IYo4ySVcIl4EfzQjjDuThxN9Gcwl0WE+eqQKYyxNJVpOsp+/Hj83qV/oDOVZ4K0afBXtOfdyWNJLeODBqjypdQ==
- Domainkey-signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns;h=to:cc:subject:references:from:date:in-reply-to:message-id:user-agent:mime-version:content-type;b=NRVo4zZtSqkxUWa39XXXdLguDlaPcjSA62NtJSMzvxcFrWzPi48oJ/7feNZSIXXtcCwYS4T/BBI9EhL91NtKiQ==
- References: <519489067.3575141218800424617.JavaMail.root@zmail02.collab.prod.int.phx2.redhat.com><m34p5mfkfa.fsf@google.com> <48BBA5AF.2080309@redhat.com>
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