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"


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


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