Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, Sergio Durigan Junior <sergiodj@redhat.com>
Subject: Re: [PATCH 2/6] Introduce `pre_expanded sals'
Date: Tue, 12 Apr 2011 20:26:00 -0000	[thread overview]
Message-ID: <m3y63f2p3b.fsf@fleche.redhat.com> (raw)
In-Reply-To: <201104121218.08910.pedro@codesourcery.com> (Pedro Alves's	message of "Tue, 12 Apr 2011 12:18:08 +0100")

>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:

Tom> This is just a way for decode_line_1 to tell the breakpoint code that
Tom> the returned sals has multiple locations but should still create just a
Tom> single breakpoint.  We needed this because a given SystemTap probe name
Tom> may have multiple locations.

Pedro> Hmm, doesn't sound right.  Conceptually, breakpoint locations are
Pedro> multiple expansions of the same source location.  Different
Pedro> source locations are different breakpoints.  E.g, bp_location
Pedro> doesn't have line number or source file fields.  From the user's
Pedro> perpective, there's only a single "point" in the source code for
Pedro> all the multiple locations for a single breakpoint.

Could you explain why this is important?  I agree this is how it is, but
I think it is actually somewhat confusing at times.


The problem I see with respect to the SystemTap change is that a given
probe location does not have a canonical name.

E.g., suppose you have a probe `program:name' that is invoked at 2
different spots in the source.  Suppose further that `break
probe:program:name' sets 2 breakpoints.  Now consider 2 scenarios:
First, the developer deletes a probe point.  Second, the developer adds
a probe point.

With the single-breakpoint approach, both of these do (what I consider
to be) the right thing -- the user ends up with what he asked for.  I
don't see how they can work with the multiple-breakpoint approach.


Furthermore, I think the `probe:' prefix should let us lift this
restriction anyhow.  It is a way of saying "this is not an ordinary
source location, but something else".


I think the deeper confusion in gdb is that an ambiguous name sets a
single breakpoint, with a single location, but the meaning of this name
is decided arbitrarily (say, by psymtab expansion order).

That is, `break file.c:73' sets a breakpoint in the first `file.c' we
happen to trip across.  Or, `break function' sets a breakpoint in the
first `function'.

I'd rather change gdb to set a breakpoint at all matching locations, and
let the user disambiguate if that is really what he wanted.

I hit this while debugging gdb itself from time to time -- try `break
parse_number' and guess where it gets set.

Tom


  parent reply	other threads:[~2011-04-12 20:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-04  3:08 Sergio Durigan Junior
2011-04-06 20:13 ` Tom Tromey
2011-04-12 11:18   ` Pedro Alves
2011-04-12 11:53     ` Jan Kratochvil
2011-04-12 13:30       ` Pedro Alves
2011-04-12 20:34         ` Tom Tromey
2011-04-12 22:22         ` Matt Rice
2011-04-13  9:53           ` Eli Zaretskii
2011-07-27 17:08         ` Tom Tromey
2011-07-29 20:36           ` Sergio Durigan Junior
2011-08-04 20:41             ` Tom Tromey
2011-08-05  3:41               ` Sergio Durigan Junior
2011-08-05 14:40                 ` Tom Tromey
2011-08-05 18:06                   ` Sergio Durigan Junior
2011-08-10 14:24           ` Tom Tromey
2011-05-03 16:09       ` Jerome Guitton
2011-05-03 18:17         ` Joel Brobecker
2011-04-12 20:26     ` Tom Tromey [this message]
2011-04-13  9:51       ` Eli Zaretskii
2011-04-13 19:20         ` Tom Tromey
2011-04-15 10:37           ` Eli Zaretskii
2011-04-18 18:37       ` Pedro Alves
2011-04-27 18:02         ` Jan Kratochvil
2011-04-29 20:42         ` Tom Tromey
2011-04-11 21:08 ` Jan Kratochvil

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=m3y63f2p3b.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=sergiodj@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