This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Introduce notion of "search name"
- From: Daniel Jacobowitz <drow at false dot org>
- To: Paul Hilfinger <hilfingr at gnat dot com>
- Cc: jimb at redhat dot com, gdb-patches at sources dot redhat dot com
- Date: Wed, 12 May 2004 09:27:09 -0400
- Subject: Re: [RFA] Introduce notion of "search name"
- References: <20040412082254.97735F2E7C@nile.gnat.com> <vt2k70g1s4t.fsf@zenia.home> <20040429103706.4793BF2BFF@nile.gnat.com> <20040429211458.GB27523@nevyn.them.org> <vt2n04umj8b.fsf@zenia.home> <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>
On Wed, May 12, 2004 at 06:59:59AM -0400, Paul Hilfinger wrote:
>
> > 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?
I like it!
--
Daniel Jacobowitz