From: Joel Brobecker <brobecker@adacore.com>
To: Phil Muldoon <pmuldoon@redhat.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>,
Eli Zaretskii <eliz@gnu.org>
Subject: Re: [patch] try 2 - Do not allow unwinder to terminate inferior in an inferior function call if a C++ exception handler cannot be found.
Date: Thu, 11 Jun 2009 17:14:00 -0000 [thread overview]
Message-ID: <20090611171437.GJ25703@adacore.com> (raw)
In-Reply-To: <4A2E3FB4.6020202@redhat.com>
> 2009-06-09 Phil Muldoon <pmuldoon@redhat.com>
>
> * infcall.c (show_unwind_on_terminating_exception_p): New
> function.
> (call_function_by_hand): Create breakpoint and clean-up call for
> std::terminate.breakpoint. Add unwind_on_terminating_exception_p
> gate. Pop frame on breakpoint hit.
> (_initialize_infcall): Add add_setshow_boolean_cmd for
> unwind-on-terminating-exception.
>
> gdb/testsuite/ChangeLog
>
> 2009-06-09 Phil Muldoon <pmuldoon@redhat.com>
>
> * gdb.cp/gdb2495.cc: New file.
> * gdb.cp/gdb2495.exp: New file.
These two parts look OK to me. Just a couple of formatting nits to be
fixed before you commit.
> + handler, unless it is in-frame). The default handler calls
> + std::terminate. This will kill the inferior. Assert that
^ Missing space
> + if (unwind_on_terminating_exception_p)
> + {
> + struct minimal_symbol *tm = lookup_minimal_symbol ("std::terminate()",
> + NULL, NULL);
> + if (tm != NULL)
> + {
> + terminate_bp = set_momentary_breakpoint_at_pc
> + (SYMBOL_VALUE_ADDRESS (tm), bp_breakpoint);
> + }
I think that the general style in GDB is to omit the curly braces
when the body of an if/while is only one statement.
> + if (terminate_bp != NULL
> + && (inferior_thread()->stop_bpstat->breakpoint_at->address
> + == terminate_bp->loc->address))
> + {
> +
> + /* We must get back to the frame we were before the
Let's remove the empty line before the comment...
> +# This is incorrect as an exception can normally and legally be handled
> +# out-of-frame. The confines of the dummy frame prevent the unwinder
> +# from finding the correct handler (or any handler, unless it is
> +# in-frame). The default handler calls std::terminate. This will kill
> +# the inferior. Assert that terminate should never be called in an
> +# inferior function call. These tests test the functionality around
> +# unwinding that sequence and also tests the flag behaviour gating this
> +# functionality.
Two spaces after a period throught the paragraph...
Thanks!
--
Joel
next prev parent reply other threads:[~2009-06-11 17:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 10:56 Phil Muldoon
2009-06-11 17:14 ` Joel Brobecker [this message]
[not found] ` <4A3193FC.3030605@redhat.com>
2009-06-13 2:21 ` Eli Zaretskii
2009-06-15 12:43 ` Phil Muldoon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090611171437.GJ25703@adacore.com \
--to=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=pmuldoon@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox