This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Search for symbol names the same way they're hashed.


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.

> 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.)

> 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.

David Carlton
carlton@math.stanford.edu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]