Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] allow unqualified function names in linespecs
Date: Tue, 20 Dec 2011 15:24:00 -0000	[thread overview]
Message-ID: <m3y5u7l1a2.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1323872680-12843-1-git-send-email-brobecker@adacore.com> (Joel	Brobecker's message of "Wed, 14 Dec 2011 09:24:40 -0500")

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel> But there are situation where it's either convenient or necessary to
Joel> avoid the fully-qualified name, and use the "simple" name instead.
Joel> For instance:
Joel>     (gdb) break foo

What situations do you mean?  A situation for the user, where it is
convenient?  Or some kind of "context" situation where if the name
cannot be found locally, gdb searches?

The latter I would like us to avoid.  My view is that linespecs are
different from expressions, and one way in particular that they are
different is that they should mean the same thing no matter the context
in which you evaluate them.

Joel> We get lucky, enjoying the side-effects of a call
Joel> cp_canonicalize_string_no_typedefs, which indirectly causes us to
Joel> perform an Ada lookup which itself causes the matching partial
Joel> psymtabs to be expanded to full symtabs.

Ugh.  This continues to be a real mess, I'm sorry about that.

Joel> What this patch does is something that I feel should be hidden
Joel> inside ada-lang. Namely, decide which matching routine to use based
Joel> on the name we are using to search for matches. I think that the
Joel> real question is to trying to find the proper interface for this.

Ok, I see, it is based on the spelling of the linespec.  I guess I am ok
with that.

I don't think it is the very best thing for us to have Ada be so very
different from the rest of GDB in so many ways -- special debuginfo
encoded in symbol names, special rules for linespecs, special rules for
iterating symbol tables.  I am sure it is better for Ada users, but the
problem is that if we want to make changes to core things in GDB,
eventually it requires you to step in and do a piece of the work.  E.g.,
we just punted on .gdb_index support for Ada.

I know it isn't super on the other side, either, with C++ setting the
norm, regardless of the applicability to other languages.  There are
probably just as many C++ hacks around :-(

[ ideas ]
Joel>   . Redesign a bit the interface.  For instance, let the language
Joel>     itself iterate over all partial symbols? The default implementation
Joel>     would do what we already do. The Ada implementation would do
Joel>     something else, not sure what yet.  And we could get rid of
Joel>     the la_symbol_name_compare method.

I suppose either this or having a way for the language to compute the
name-matching function.

I am not so sure about an Ada-specific psymtab walker.  I think I'd have
to see the patch or a fuller proposal.

Tom


  reply	other threads:[~2011-12-20 15:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14 14:36 Joel Brobecker
2011-12-20 15:24 ` Tom Tromey [this message]
2011-12-21 14:08   ` Joel Brobecker
2011-12-23 10:39     ` [commit/Ada 1/3] New function ada-lang.c:should_use_wild_match Joel Brobecker
2011-12-27  4:27       ` Checked in: " Joel Brobecker
2011-12-23 10:39     ` unqualified function names in linespecs in Ada... (try #2) Joel Brobecker
2011-12-23 10:39     ` [RFA 2/3] Ada: allow unqualified function names in linespecs Joel Brobecker
2012-01-12  3:13       ` Joel Brobecker
2012-01-19 15:40       ` Joel Brobecker
2012-01-24 19:41       ` Tom Tromey
2012-01-26  4:23         ` Joel Brobecker
2012-01-26 10:22           ` Crash regression gdb.cp/no-dmgl-verbose.exp: " Jan Kratochvil
2012-01-26 10:55             ` Jan Kratochvil
2012-01-27  5:15             ` Jan Kratochvil
2012-01-27  5:25               ` Joel Brobecker
2012-01-27 17:09                 ` [patch] Fix the 2012-01-26 regression by la_get_symbol_name_match_p [Re: Crash regression gdb.cp/no-dmgl-verbose.exp] Jan Kratochvil
2012-01-27 19:27                   ` Joel Brobecker
2012-01-27 20:33                     ` [commit] " Jan Kratochvil
2011-12-23 11:01     ` [RFA 3/3] Remove language param from name_matcher in struct quick_symbol_functions Joel Brobecker
2012-01-12  4:30       ` Joel Brobecker
2012-01-19 15:47       ` Joel Brobecker
2012-01-24 19:45       ` Tom Tromey
2012-01-26  4:57         ` Joel Brobecker
2012-01-24 19:17     ` [RFC] allow unqualified function names in linespecs 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=m3y5u7l1a2.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@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