From: Tom Tromey <tromey@redhat.com>
To: GDB Development <gdb@sourceware.org>
Subject: some questions about ranged breakpoints
Date: Mon, 10 Oct 2011 20:04:00 -0000 [thread overview]
Message-ID: <m3botobom4.fsf@fleche.redhat.com> (raw)
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
next reply other threads:[~2011-10-10 20:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 20:04 Tom Tromey [this message]
2011-10-11 10:11 ` Pedro Alves
2011-10-11 14:50 ` Tom Tromey
2011-10-11 15:22 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3botobom4.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox