From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Hilfinger To: jimb@redhat.com Cc: cagney@gnu.org, drow@false.org, gdb-patches@sources.redhat.com Subject: Re: [RFA] Introduce notion of "search name" Date: Wed, 19 May 2004 09:55:00 -0000 Message-id: <20040519095542.59702F2DAF@nile.gnat.com> 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> <40A2313E.1080100@gnu.org> <20040513093023.9718CF2B55@nile.gnat.com> X-SW-Source: 2004-05/msg00561.html > 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 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