From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Two identical "else if" blocks ?
Date: Mon, 01 Jan 2007 03:52:00 -0000 [thread overview]
Message-ID: <20070101035248.GE3428@adacore.com> (raw)
Hello,
While reviewing everyone comments regarding the patch for catching
Ada exceptions, I noticed the following code in remove_breakpoint:
else if ((b->owner->type == bp_catch_catch ||
b->owner->type == bp_catch_throw)
&& breakpoint_enabled (b->owner)
&& !b->duplicate)
{
val = target_remove_breakpoint (&b->target_info);
if (val)
return val;
b->inserted = (is == mark_inserted);
}
else if (ep_is_exception_catchpoint (b->owner)
&& b->inserted /* sometimes previous insert doesn't happen */
&& breakpoint_enabled (b->owner)
&& !b->duplicate)
{
val = target_remove_breakpoint (&b->target_info);
if (val)
return val;
b->inserted = (is == mark_inserted);
}
Since ep_is_exception_catchpoint is:
return (ep->type == bp_catch_catch) || (ep->type == bp_catch_throw);
It looks like the two blocks are completely identical, and we should
be able to remove one of them. Should I perhaps test what happens
when I delete, say, the first one?
--
Joel
next reply other threads:[~2007-01-01 3:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-01 3:52 Joel Brobecker [this message]
2007-01-01 4:01 ` Daniel Jacobowitz
2007-01-01 14:12 ` [commit] (was: "Re: Two identical "else if" blocks ?") Joel Brobecker
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=20070101035248.GE3428@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/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