This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Introduce notion of "search name"
- From: Paul Hilfinger <hilfingr at gnat dot com>
- To: drow at false dot org
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 2 Apr 2004 03:29:55 -0500 (EST)
- Subject: Re: [RFA] Introduce notion of "search name"
- References: <20040303191550.7307DF2DB8@nile.gnat.com> <20040305035955.GH5320@nevyn.them.org> <20040305103925.A4815F2EE4@nile.gnat.com> <20040331221249.GA6811@nevyn.them.org>
>> So as an interim measure, I use your suggestion of 21 Jan and first
>> try to find an objfile via the BFD section. When that doesn't work, I
>> simply use a global hashtable to hold the demangled strings. Yes,
>> that is a memory leak, but on consideration, I realized that it's only
>> REALLY a memory leak if (a) I routinely change the entire set of
>> demangled names numerous times during a single GDB session, or (b)
>> demangle entirely different, large sets of names each time I reload
>> the symbol tables. Yeah, I know, it's not pretty, but again I am hoping
>> it will ensure that demangled names behave until the next interation of
>> symtab modifications allow an entirely different strategy.
> I'm not sure what others will think of this interim measure. I don't
> like it much, though.
I'm not overly fond of any of these solutions myself; they simply have
effectiveness to recommend them. All I really need is to be able to
find an objfile, *any* objfile really, whose lifetime is at least as
great as the symbols are supposed to be. Or I could keep an obstack
for this purpose, IF there were some way to know a safe time to
reinitialize it (again, after the symbols die).
> What you did not explain is how [SYMBOL_DEMANGLED_SEARCH_NAME]
> is supposed to be different from SYMBOL_SEARCH_NAME.
Well, the direct answer is that for Ada,
SYMBOL_DEMANGLED_SEARCH_NAME (sym) == NULL
whereas
SYMBOL_SEARCH_NAME (sym) == the "linkage name" of the symbol
Perhaps, now that you bring it up, it might be clearer simply to make
this a predicate:
SYMBOL_SEARCHED_BY_DEMANGLED_NAME (sym)
or something like that?
> The existing ada_demangle never fails. How does that interact with
> what you said above? Hopefully not by tagging all minsyms as Ada!
Ah, I have been putting off syncing the ada-* files with ours (they
aren't compiled at the moment, and I feel no need to clutter the
public file system with unused versions. However, perhaps it's time to
check in the current versions, which are considerably different from the
snapshot that's currently there. In short: you are quite right, and the
current Ada demangler returns NULL for non-Ada-mangled symbols.
Paul