This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
some questions about ranged breakpoints
- From: Tom Tromey <tromey at redhat dot com>
- To: GDB Development <gdb at sourceware dot org>
- Date: Mon, 10 Oct 2011 14:03:47 -0600
- Subject: some questions about ranged breakpoints
While implementing the ambiguous linespec proposal, I've tripped across
an oddity involving ranged breakpoints. I don't think I have access to
a machine that implements these, so I thought I'd ask here.
update_breakpoint_locations has:
/* Ranged breakpoints have only one start location and one end location. */
gdb_assert (sals_end.nelts == 0 || (sals.nelts == 1 && sals_end.nelts == 1));
But breakpoint_re_set_default has:
expanded_end = expand_line_sal_maybe (sals_end.sals[0]);
expand_line_sal_maybe can return a symtabs_and_lines that has multiple
results. This will crash gdb.
I think you could construct a case using a function which is inlined.
Then set a breakpoint like "break-range foo.h:7, +5".
If breakpoint re-setting discovers multiple locations for the function
(e.g., the inferior loads a .so that has inlined it), then it should
crash.
What should actually happen here?
I think the simplest approach would be to make such breakpoints not be
resettable. Failing that I suppose they could deactivate if resetting
introduces ambiguity. Any other ideas? Any preferences?
Also if someone has a use-case for ranged breakpoints I would like to
know what it is. I couldn't think of a situation where I'd use them.
Tom