This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]