[RFA 3/3] Move logic out of symbol_find_demangled_name

Pedro Alves palves@redhat.com
Tue Jun 7 14:03:00 GMT 2016


On 06/06/2016 03:14 PM, Yao Qi wrote:
> Tom Tromey <tom@tromey.com> writes:
> 
>> > I'm not especially fond of the new name, "la_demangle_for_symbol".
>> >
> How about "la_sniff_by_symbol"?  IMO, symbol_find_demangled_name does
> two things, set the language of symbol, and get the demangled name.
> It is quite similar to frame unwinder sniffer and frame unwinding.
> 

I have to admit that it took me a bit to understand what the "by" meant,
but I think it intends to convey:

  "sniff the symbol's language from the symbol's mangled name".

So s/by symbol/from symbol/ would be better, IMHO.

symbol_find_demangled_name says:

/* (...) attempt to find any demangling algorithm that works and
   then set the language appropriately.  The returned name is allocated
   by the demangler and should be xfree'd.  */

So IMHO, something like "la_sniff_from_mangled_name" would be
even clearer.

BTW, what do we do with the resulting demangled name?  Is
there some sort of guideline for options to pass to the demangler?
Some sort of output that we're aiming for?

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list