public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* some questions about ranged breakpoints
@ 2011-10-10 20:04 Tom Tromey
  2011-10-11 10:11 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2011-10-10 20:04 UTC (permalink / raw)
  To: GDB Development

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-11 15:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-10 20:04 some questions about ranged breakpoints Tom Tromey
2011-10-11 10:11 ` Pedro Alves
2011-10-11 14:50   ` Tom Tromey
2011-10-11 15:22     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).