Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <ghost@cs.msu.su>
To: gdb@sources.redhat.com
Subject: Re: Multiple breakpoint locations
Date: Wed, 14 Nov 2007 06:13:00 -0000	[thread overview]
Message-ID: <fhe3ls$ail$1@ger.gmane.org> (raw)
In-Reply-To: <u6405ea01.fsf@gnu.org>

Eli Zaretskii wrote:

>> Date: Tue, 13 Nov 2007 15:39:31 -0800
>> From: "Douglas Evans" <dje@google.com>
>> Cc: "Vladimir Prus" <ghost@cs.msu.su>, gdb@sources.redhat.com
>> 
>> On Nov 13, 2007 2:18 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> > > From:  Vladimir Prus <ghost@cs.msu.su>
>> > > Date:  Tue, 13 Nov 2007 22:28:15 +0300
>> > >
>> > > >   (gdb) d 1.1
>> > > >   warning: bad breakpoint number at or near '1.1'
>> > >
>> > > Well, you can't really delete a location -- if breakpoint expression
>> > > corresponds to 20 addresses, that's the way it is -- you cannot
>> > > delete some of those addresses from the program ;-)
>> >
>> > Sorry, I don't understand why; can you please elaborate?  Removing a
>> > breakpoint instruction from a specific address is a primitive
>> > operation of the target back-end; why can't we use it for that single
>> > address?

Because after that, the output of 'info break' will no longer correspond
accurately to what the program is. If there are 20 locations in program,
and 'info break' shows 20 locations, it means the user sees *all* locations.
He can disable some of them, and then he'll see that some of locations
are disabled. If you allow removing a location, it means the list of location
starts to show all locations except for previously removed ones, and there's
no way to investigate which removed locations were there, how many are
removed and so on. It seems to be that disabling undesired locations
is more transparent approach.

>> I think it's a question of how much complexity one wants here.  AIUI,
>> the breakpoint is represented as source+line.  One would have to
>> augment that to mean source+line+except-this (I think).
> 
> Not necessarily.  You could look up the struct bp_location that
> corresponds to 1.1 (by using its address as a key), and remove that
> struct bp_location from the chain we maintain for breakpoint 1.
> 
>> Also, it's not just "delete 1.1".  It's also condition, commands, and
>> ignore.
> 
> Well, removing struct bp_location should take care of that as well.
> Am I missing something?
> 
>> I'm not suggesting all (or any) should be supported, just that we
>> shouldn't tackle any of them without thinking the big picture
>> through at least a bit.
> 
> Well, my big picture is that today we have no solution for the
> following use case: (a) I set a breakpoint that results in multiple
> locations; (b) I look at "info break" and realize that some of these
> locations are irrelevant for the problem I'm debugging, and I don't
> want the program to stop there (e.g., maybe stopping there will
> disrupt some timing); (c) I want to remove these locations from the
> breakpoints list.

You disable those locations, and gdb no longer stops there. And GDB, furthermore,
will try hard to keep those locations disabled as shared libraries are 
loaded and unloaded.

- Volodya







  parent reply	other threads:[~2007-11-14  6:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-13 19:15 Nick Roberts
2007-11-13 19:28 ` Vladimir Prus
2007-11-13 19:59   ` Daniel Jacobowitz
2007-11-13 20:09   ` Nick Roberts
2007-11-13 20:14     ` Daniel Jacobowitz
2007-11-13 20:18     ` Bob Rossi
2007-11-13 20:19     ` Vladimir Prus
2007-11-13 22:03     ` Andreas Schwab
2007-11-14  6:20       ` Vladimir Prus
2007-11-14 10:12         ` Andreas Schwab
2007-11-14 21:26           ` Jim Blandy
2007-11-14 21:34             ` Vladimir Prus
2007-11-14 22:08             ` Andreas Schwab
2007-11-15  4:08             ` Eli Zaretskii
2007-11-15 13:37               ` Daniel Jacobowitz
2007-11-15 16:50               ` Jim Blandy
2007-11-13 22:18   ` Eli Zaretskii
2007-11-13 23:39     ` Douglas Evans
2007-11-14  4:17       ` Eli Zaretskii
2007-11-14  5:02         ` Joel Brobecker
2007-11-14  6:13         ` Vladimir Prus [this message]
2007-11-14 18:54           ` Eli Zaretskii
2007-11-14 19:00             ` Vladimir Prus
2007-11-17 11:55 ` Eli Zaretskii
2007-11-17 12:07 ` Eli Zaretskii
2007-11-17 14:14   ` Vladimir Prus
2007-11-17 15:36     ` Eli Zaretskii
2007-11-18  1:32       ` Nick Roberts
2007-11-18  2:26         ` Daniel Jacobowitz
2007-11-18  8:47           ` Nick Roberts
2007-11-19 12:57             ` Daniel Jacobowitz

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='fhe3ls$ail$1@ger.gmane.org' \
    --to=ghost@cs.msu.su \
    --cc=gdb@sources.redhat.com \
    /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