Demangling and searches
Daniel Berlin
dberlin@dberlin.org
Wed Jan 8 00:38:00 GMT 2003
On Tuesday, January 7, 2003, at 07:13 PM, David Carlton wrote:
> On Tue, 07 Jan 2003 15:54:36 -0800, Paul Hilfinger
> <hilfingr@CS.Berkeley.EDU> said:
>
>> For some time, I've been meaning to ask a basic question about GDB
>> search strategy: for language implementations that mangle their
>> identifiers, the standard procedure in GDB at the moment is to
>> search for the demangled identifier among the demangled identifiers
>> of the symbol table, and to speed this search up by precomputing and
>> storing the demangled symbol names. Why?
>
>> We used to do that for Ada mode in GDB, but subsequently changed our
>> approach entirely. For Ada, we MANGLE the symbol we're searching
>> for and then search among the MANGLED (i.e., raw, unmodified,
>> warm-from- the-executable) names.
>
> I'm curious: in Ada, what does the mangling do? In particular, how
> much type info does it contain? In C++, the mangled name contains
> type info for the arguments for functions; I don't see how, using
> GDB's current data structures, to allow us to allow users to, say,
> break on a function without requiring them to specify the types of the
> arguments, if we took your approach. (Though it might be possible to
> modify GDB's data structures to allow that.)
Further, the mangling is ABI dependent.
Thus, you'd have to know what ABI the symbol you are looking up is
going to use, to mangle it properly
More information about the Gdb
mailing list