[commit] (was: "Re: Two identical "else if" blocks ?")
Joel Brobecker
brobecker@adacore.com
Mon Jan 1 14:12:00 GMT 2007
> > 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?
>
> They're not 100% the same (there's an extra b->inserted check) so I'd
> recommend deleting the second one, since it's dead code.
Argh! I knew I had a blind spot :-/.
I've checked the following change in after having tested in on x86-linux.
2006-01-01 Joel Brobecker <brobecker@adacore.com>
* breakpoint.c (remove_breakpoint): Remove dead code.
--
Joel
-------------- next part --------------
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.234
diff -u -p -r1.234 breakpoint.c
--- breakpoint.c 18 Dec 2006 22:10:13 -0000 1.234
+++ breakpoint.c 1 Jan 2007 06:05:33 -0000
@@ -1637,17 +1637,6 @@ remove_breakpoint (struct bp_location *b
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);
- }
return 0;
}
More information about the Gdb-patches
mailing list