From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Daniel Jacobowitz Cc: Paul Hilfinger , jimb@redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFA] Introduce notion of "search name" Date: Wed, 12 May 2004 14:14:00 -0000 Message-id: <40A2313E.1080100@gnu.org> References: <20040412082254.97735F2E7C@nile.gnat.com> <20040429103706.4793BF2BFF@nile.gnat.com> <20040429211458.GB27523@nevyn.them.org> <20040430084538.ECDE1F2E1C@nile.gnat.com> <20040430134955.GA15786@nevyn.them.org> <20040503084937.439F4F2C0A@nile.gnat.com> <20040511194843.GA15952@nevyn.them.org> <20040512105959.806E6F2DE4@nile.gnat.com> <20040512132708.GA25122@nevyn.them.org> X-SW-Source: 2004-05/msg00367.html 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