From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Hilfinger To: drow@false.org Cc: jimb@redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFA] Introduce notion of "search name" Date: Wed, 12 May 2004 11:00:00 -0000 Message-id: <20040512105959.806E6F2DE4@nile.gnat.com> References: <20040402082955.CCEF3F2F2A@nile.gnat.com> <20040409215112.GB851@nevyn.them.org> <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> X-SW-Source: 2004-05/msg00365.html > Unfortunately, discussion of that took over the thread, and you never > answered my last question about this patch: > > On Fri, Apr 02, 2004 at 03:29:55AM -0500, Paul Hilfinger wrote: > > > What you did not explain is how [SYMBOL_DEMANGLED_SEARCH_NAME] > > > is supposed to be different from SYMBOL_SEARCH_NAME. > > > > Well, the direct answer is that for Ada, > > SYMBOL_DEMANGLED_SEARCH_NAME (sym) == NULL > > whereas > > SYMBOL_SEARCH_NAME (sym) == the "linkage name" of the symbol > > Perhaps, now that you bring it up, it might be clearer simply to make > > this a predicate: > > SYMBOL_SEARCHED_BY_DEMANGLED_NAME (sym) > > or something like that? > > I don't think that either of those divisions is general enough to be > useful. Why should the search name have to be the linkage name or the > demangled name? For C++ there are two potential 'search names' - the > name without DMGL_PARAMS, or just the basename. Neither of these is > the linkage or natural name. > > I don't want us to proliferate name-related macros without a very clear > understanding of when each one is appropriate. Daniel, 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? Paul