This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: names of symbols
- From: "Paul N. Hilfinger" <hilfingr at otisco dot mckusick dot com>
- To: carlton at kealia dot com
- Cc: gdb at sources dot redhat dot com, hilfinger at gnat dot com
- Date: Wed, 2 Jul 2003 02:45:47 -0700
- Subject: Re: names of symbols
- References: <yf2n0fyi5v4.fsf@hawaii.kealia.com>
- Reply-to: Hilfinger at otisco dot mckusick dot com
David,
This certainly sounds like a convenient direction from our standpoint. A
few considerations come to mind:
1. Most trivial (and therefore most annoying and contentious (;->)): the
name SYMBOL_MATCHES_NATURAL_NAME is not entirely descriptive of what
we do and of what one would want to do. As I described our strategy
to you, we first mangle the name and then search for a match with
SYMBOL_SEARCH_NAME. I'm not sure that
SYMBOL_MATCHES_NATURAL_NAME (symbol, name);
conveys that NAME might not be a natural name.
2. This makes me wonder a little about cross-language queries---e.g.,
asking for an Ada symbol from C++ code. How does C++ know to mangle?
Well, probably the solution of using 'set lang ada' temporarily in this
case isn't so terribly bad.
3. I was a bit puzzled about what to do with this, from
build_minimal_symbol_hash_tables:
if (SYMBOL_DEMANGLED_NAME (msym) != NULL)
add_minsym_to_demangled_hash_table (msym,
objfile->msymbol_demangled_hash);
In Ada, I have no need of this hash table, but we DO need to demangle
names. It seems odd, but am I expected to provide a SYMBOL_DEMANGLED_NAME
that is NULL and a SYMBOL_NATURAL_NAME that is ... um ... natural?
4. As to other bits: what did you think of my suggestion of handling
multiple matches with a version of symbol_lookup that takes a
call-back as argument (i.e., to be called with each matching symbol)?
Paul