[RFA] Introduce notion of "search name"

Paul Hilfinger hilfingr@gnat.com
Wed May 19 09:55:00 GMT 2004


> But, either way, I don't think this patch should be blocked on making
> that overhaul.
...
> If Daniel J. has signed off on this, it looks fine to me.

I am interpreting his messages as saying he was (he will no doubt
swiftly correct me otherwise).  Great!  In that case, I will commit
this patch later today, after running the test suite.

> Paul Hilfinger <hilfingr@gnat.com> writes:
> > I am actually sympathetic to Andrew's ideas here, since with some
> > version of the extra abstraction he suggests, I could avoid all
> > permanent storage for demangled names.
> 
> I think generalizing names is probably the way to go.  Certainly C++
> needs names with some structure; using strings there is silly.  I'm
> not convinced it can be made quite as simple as Andrew says, but I
> could be wrong about that.

In view of the fact that both you and Andrew seem to think that more 
abstraction is needed here, and in view of the fact that I believe I could 
take advantage of a properly formulated abstraction to further reduce memory 
needs, I will undertake to revisit this issue after getting a reasonable
amount of Ada support stably ported to the public version.  

> >        add_minsym_to_hash_table (msym, objfile->msymbol_hash);
> >  
> >        msym->demangled_hash_next = 0;
> > -      if (SYMBOL_DEMANGLED_NAME (msym) != NULL)
> > +      if (SYMBOL_SEARCH_NAME (msym) != SYMBOL_LINKAGE_NAME (msym))
> >  	add_minsym_to_demangled_hash_table (msym,
> >                                              objfile->msymbol_demangled_hash);
> >      }

> We can use != to compare the names here because symbol_set_names only
> stores pointers to objfile->demangled_names_hash keys --- right?

Close.  The minimal symbol demangled hash table is needed only when
one searches for symbols using some key that differs from the "linkage
name".  The condition

     SYMBOL_SEARCH_NAME (msym) != SYMBOL_LINKAGE_NAME (msym)

must necessarily be true in that case, regardless of where we store demangled
names.  My intention was that when there is no demangled name distinct from
the "linkage name", then SYMBOL_SEARCH_NAME should return the same 
object as "linkage name" (which reminds me that I must update the comment
to that effect before submitting).   

Paul Hilfinger



More information about the Gdb-patches mailing list