Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: implement ambiguous linespec proposal
Date: Tue, 08 Nov 2011 16:36:00 -0000	[thread overview]
Message-ID: <m339dyk1v6.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20111104074543.GA13839@host1.jankratochvil.net> (Jan	Kratochvil's message of "Fri, 4 Nov 2011 08:45:43 +0100")

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> Compiler says:
Jan> .C:13:6: error: call of overloaded ‘m()’ is ambiguous
Jan> .C:13:6: note: candidates are:
Jan> .C:6:7: note: int N2::m()
Jan> .C:2:7: note: int N1::m()

Jan> and I think GDB should also say the same output as error.

I agree for expressions.  I think linespecs are different.

For example, with ADL, a plain name like "function" may be looked up in
the namespaces of the arguments.  I don't see how linespec will ever
handle this sanely.

GDB is already inconsistent here, BTW.  For example, "break k::m" will
search superclasses of "k", but "break m" will not search superclasses
of the class of *this.

I have been thinking about this, though, and I think there is another
approach that could work.

Jan> One can store the available namespaces as strings with the
Jan> breakpoint (instead of storing pointer to the block - where the
Jan> block may disappear).

Yeah.  I would like to store as little context as possible, though.  Or,
rather, I would like all the context to appear in the linespec's
canonical form.


The way we could make this work is that we could have decode_line_full
return sets of SALs, where each set is distinguished by its canonical
name.  So, in this case, we would return two sets, one "N1::m" and one
"N2::m".

Then, this would create two separate breakpoints -- one per set.

This is more complicated than just rejecting this case, but it would let
us preserve namespace searches.

I think it would also make some Ada cases work more sanely, though I
don't know enough to say with certainty.  I'm thinking here about how
ada_lookup_symbol_list returns a list but then the linespec code only
uses the first one (via some call through ada_lookup_encoded_symbol, I
don't remember the details).


My problem with this is that it adds more complexity to the user
interface: some linespecs will create a single breakpoint with multiple
locations, some will create multiple breakpoints once again, depending
on the context.

So, I am still against it, but I will take a stab at it if you think it
is important.

Tom


  reply	other threads:[~2011-11-08 16:36 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 17:34 Tom Tromey
2011-10-28 20:52 ` Matt Rice
2011-11-01 20:38   ` Tom Tromey
2011-10-28 22:41 ` Jan Kratochvil
2011-11-01 20:58   ` Tom Tromey
2011-11-03 20:49     ` Tom Tromey
2011-11-04  7:46       ` Jan Kratochvil
2011-11-08 16:36         ` Tom Tromey [this message]
2011-11-09 16:05           ` Joel Brobecker
2011-11-09 17:12             ` Tom Tromey
2011-11-09 17:56               ` Joel Brobecker
2011-11-09 18:19                 ` Tom Tromey
2011-11-09 19:00                   ` Joel Brobecker
2011-11-14 21:04                     ` Tom Tromey
2011-11-14 21:32                       ` Jerome Guitton
2011-11-09 18:37           ` Tom Tromey
2011-11-14 21:11             ` Tom Tromey
2011-11-15 16:30               ` Tom Tromey
2011-11-15 16:59                 ` Pierre Muller
2011-11-16  0:09                 ` Jan Kratochvil
2011-11-16  1:58                   ` Joel Brobecker
2011-11-16 14:46                   ` Tom Tromey
2011-11-18 14:10                     ` Tom Tromey
2011-11-16 21:23                 ` Stan Shebs
2011-11-16  2:28               ` Yao Qi
2011-11-16  3:20                 ` Doug Evans
2011-11-16 14:46                 ` Tom Tromey
2011-11-16 16:06                   ` Tom Tromey
2011-11-16  4:57               ` Doug Evans
2011-11-16  5:22                 ` Doug Evans
2011-11-16 14:54                   ` Tom Tromey
2011-11-16 16:32                     ` Doug Evans
2011-11-16 16:39                       ` Tom Tromey
2011-11-16 14:49                 ` Tom Tromey
2011-11-16  8:15               ` Yao Qi
2011-11-16 16:17                 ` Tom Tromey
2011-11-16 15:43               ` Yao Qi
2011-11-16 16:11                 ` Tom Tromey
2011-11-16 16:44                   ` Tom Tromey
2011-11-17  3:49                     ` Yao Qi
2011-11-21 21:50                       ` Tom Tromey
2011-11-23 21:33               ` Tom Tromey

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=m339dyk1v6.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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