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] Introduce notion of "search name"



OK.  The only use for SYMBOL_SEARCHED_BY_DEMANGLED_NAME is to answer
the question, "Do we need to index this minimal symbol under its
demangled name?"  It would work to re-write the test in
build_minimal_symbol_hash_tables as

      if (SYMBOL_SEARCH_NAME (msym) != SYMBOL_LINKAGE_NAME (msym))
	add_minsym_to_demangled_hash_table (msym,
                                            objfile->msymbol_demangled_hash);

from the current

     if (SYMBOL_DEMANGLED_NAME (msym) != NULL)
	...

(although to use !=, you'd also want to document the fact that when
SYMBOL_SEARCH_NAME is strcmp-equal to SYMBOL_LINKAGE_NAME, it is also
pointer equal). This re-write avoids introducing a new name, answering one of your objections. Furthermore, minimal symbols are searched for only
by the linkage name or the search name (by definition), so it seems that the
proposed test is correct.


What do you think?


I like it!

Brain explodes.


Why, when doing these symtab comparisons, are we insisting that the symtab convert everything to a string, and then that the client manipulate that?

Surely the only time a symbol name needs to be converted to a published string is when we print it (even then *sym_puts (sym, ui_file) would do). For other cases, the last thing we should be doing is locking the symtab into string representations. Instead it should publish interfaces such as:
sym_demangled_cmp (sym1, sym2)
and I suspect that there's an equivalent here.


Andrew





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