From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Berlin To: "Peter.Schauer" Cc: msnyder@cygnus.com, jimb@cygnus.com, gdb-patches@sources.redhat.com, ezannoni@cygnus.com Subject: Re: [RFA]: Fix partial symbol lookups Date: Thu, 16 Nov 2000 08:56:00 -0000 Message-id: References: <200011161629.RAA06158@reisser.regent.e-technik.tu-muenchen.de> X-SW-Source: 2000-11/msg00207.html "Peter.Schauer" writes: > > > The previous version of lookup_partial_symbol (before your changes) would > > > have found both mangled and demangled names. > > > > Now this I take issue with. > > How could it possibly find demangled names, if it doesn't have access > > to them? > > lookup_partial_symbol didn't find demangled names before my patch on > > 10-12. It doesn't have the code to do so, as you pointed out yourself > > (because the SYMBOL_MATCHES_NAME is no better than the strcmp, since > > we have no access to demangled names), unless the symbol name was the > > demangled name, rather than the mangled name, which doesn't occur. > > Not true. > There were no demangled names in partial symbols from most symbol readers, > _except_ for the HP reader, which we are currently discussing, and which > I discovered rather late in the day as well. > Before your change, lookup_partial_symbol fell back to a linear search > if it didn't find the symbol and had the chance to find the demangled symbol > via SYMBOL_MATCHES_NAME during the linear search. Peter, you are missing an important point. *I* added that SYMBOL_MATCHES_NAME. Not HP. As the comment shows right above it. In the GDB-5.0 source, it's while (STREQ (SYMBOL_NAME (*top), name)) { if (SYMBOL_NAMESPACE (*top) == namespace) { return (*top); } top++; } So we couldn't have possibly been finding demangled names until I added that, and since the HP code is older than the change to use SYMBOL_MATCHES_NAME, they couldn't have had demangled names working in partial symbol lookups. --Dan