some questions about ranged breakpoints
Tom Tromey
tromey@redhat.com
Mon Oct 10 20:04:00 GMT 2011
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
More information about the Gdb
mailing list