Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: David Carlton <carlton@math.stanford.edu>
Cc: Jim Blandy <jimb@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: RFA: Search for symbol names the same way they're hashed.
Date: Wed, 02 Oct 2002 13:02:00 -0000	[thread overview]
Message-ID: <20021002200203.GA4762@nevyn.them.org> (raw)
In-Reply-To: <ro1ptussk5h.fsf@jackfruit.Stanford.EDU>

On Wed, Oct 02, 2002 at 12:41:46PM -0700, David Carlton wrote:
> On 02 Oct 2002 14:18:51 -0500, Jim Blandy <jimb@redhat.com> said:
> > David Carlton <carlton@math.stanford.edu> writes:
> 
> >> 1) This concept of 'a name that is as demangled as possible' is a
> >> pretty important one and occurs in multiple places in GDB's sources,
> 
> > Yeah, I think we need something like that, too.
> 
> > How about SYMBOL_DEMANGLEDEST_NAME?  Um.
> 
> Um indeed.

Dare I suggest SYMBOL_SEARCH_NAME?  That is, the only name we should
search for when we're looking up this function in symbol tables.  Since
that's the other use.

> > I just did a quick survey of the uses of SYMBOL_SOURCE_NAME.
> 
> Thanks!  I'd been meaning to do that, but I hadn't gotten around to it
> yet.  Also, somebody should look at all uses of SYMBOL_DEMANGLED_NAME
> to see which ones are part of a chunk of code that could be replaced
> by SYMBOL_BEST_NAME.
> 
> > They all fall into two categories:
> > - printing symbol names, and
> > - sort comparison functions.
> 
> > The first usage is exactly correct: the way a symbol prints should
> > respect the current demangling setting.
> 
> > The second usage seems wrong to me: if you sort under one demangling
> > setting, but then search under a different one, well, ... duh.
> 
> Right.  That's exactly what I was afraid of: we should make it clear
> that SYMBOL_SOURCE_NAME is for external use only.  (Both by comments
> and by renaming it, as you suggest below.)

Blech.  There's some of these left?  I swear I fixed them!  I see, in
symtab.c, bogus uses in lookup_partial_symbol and lookup_block_symbol,
but only in the linear search code.  So I think I got the rest.  The
ones for sort_search_symbols are benign.

> > The source code name of a symbol does not depend depend on the current
> > demangling setting; the way it should be printed obviously does.  So
> > I'd suggest:
> > - changing the first category of uses to use SYMBOL_PRINT_NAME,
> >   a new macro which will be defined just like the current
> >   SYMBOL_SOURCE_NAME (or David's defn below looks nice, too), and
> > - defining a new SYMBOL_SOURCE_NAME which does what David's
> >   SYMBOL_BEST_NAME does above.
> 
> I agree.

I agree about SYMBOL_PRINT_NAME... or, how about SYMBOL_PRINTABLE_NAME?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2002-10-02 20:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-01 20:45 Jim Blandy
2002-10-02 10:45 ` David Carlton
2002-10-02 12:35   ` Jim Blandy
2002-10-02 12:41     ` David Carlton
2002-10-02 13:02       ` Daniel Jacobowitz [this message]
2002-10-02 13:20         ` David Carlton
2002-10-02 13:25           ` Daniel Jacobowitz
2002-10-02 13:43     ` Daniel Berlin
2002-10-02 14:03       ` Daniel Jacobowitz
2002-10-02 16:10         ` Daniel Berlin
2002-10-02 16:19           ` Setting the demangling style Daniel Jacobowitz
2002-10-02 11:04 ` RFA: Search for symbol names the same way they're hashed Daniel Jacobowitz
2002-10-02 12:10   ` David Carlton
2002-10-07 16:19   ` David Carlton
2002-10-07 16:38     ` Daniel Jacobowitz
     [not found] <1033595444.9324.ezmlm@sources.redhat.com>
2002-10-02 17:49 ` Jim Ingham
2002-10-02 18:16   ` Daniel Jacobowitz
2002-10-02 18:25     ` Jim Ingham
2002-10-03  8:15       ` Daniel Berlin

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=20021002200203.GA4762@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=carlton@math.stanford.edu \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jimb@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