This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Two identical "else if" blocks ?
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 1 Jan 2007 07:52:49 +0400
- Subject: Two identical "else if" blocks ?
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