From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24714 invoked by alias); 13 Dec 2011 21:26:12 -0000 Received: (qmail 24705 invoked by uid 22791); 13 Dec 2011 21:26:11 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Dec 2011 21:25:49 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A712F2BB17A; Tue, 13 Dec 2011 16:25:48 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fsUIQnkKs99G; Tue, 13 Dec 2011 16:25:48 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 92D1E2BB101; Tue, 13 Dec 2011 16:25:48 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id AB783145615; Tue, 13 Dec 2011 13:25:47 -0800 (PST) Date: Tue, 13 Dec 2011 21:30:00 -0000 From: Joel Brobecker To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Use symbol search name in expand_symtabs_matching_via_partial... Message-ID: <20111213212547.GR21915@adacore.com> References: <1323808430-18660-1-git-send-email-brobecker@adacore.com> <20111213204504.GA7129@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111213204504.GA7129@host2.jankratochvil.net> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00427.txt.bz2 > > --- a/gdb/psymtab.c > > +++ b/gdb/psymtab.c > > @@ -1305,7 +1305,7 @@ expand_symtabs_matching_via_partial > > || (kind == TYPES_DOMAIN > > && SYMBOL_CLASS (*psym) == LOC_TYPEDEF)) > > && (*name_matcher) (current_language, > > - SYMBOL_NATURAL_NAME (*psym), data)) > > + SYMBOL_SEARCH_NAME (*psym), data)) > > It will need the same change for .gdb_index in write_psymbols. > > It would also mean .gdb_index version should be increased and backward > compatibility implemented although IMHO it can be ignored for Ada, not sure if > Ada users deploy .gdb_index. Thanks for the quick review, Jan. How about the following. As explained in the revision history, I ended up not incrementing the version number, because I don't think we have a compatibility issue. The only language for which it would have made a difference (search-name != natural-name) is Ada, and the feature is not supported for Ada. So... gdb/ChangeLog: * psymtab.c (expand_symtabs_matching_via_partial): Match the partial symbols using their SYMBOL_SEARCH_NAME. * dwarf2read.c (write_psymbols): Use SYMBOL_SEARCH_NAME instead of SYMBOL_NATURAL_NAME in index entry. Still testing, but I do not expect any regression. Thanks, -- Joel commit a46ee1ab51430ba315cb20bb46555f5e76d4171e Author: Joel Brobecker Date: Tue Dec 13 15:24:53 2011 -0500 Use symbol search name in expand_symtabs_matching_via_partial... We are iterating over all symbols in a partial symtab that would match a given name, so we should match the partial symbols search name against the given name rather than using the natural name. In C++, that does not make a difference, but it does in Ada, because Ada searches using the symbol encoded name... We also update the generation of the .gdb_index file to match this change in the search. Although technically an incompatible change, we do not increment the gdb_index version number, because Ada is the only language where it would make a difference - except that this feature is not supported for Ada. gdb/ChangeLog: * psymtab.c (expand_symtabs_matching_via_partial): Match the partial symbols using their SYMBOL_SEARCH_NAME. * dwarf2read.c (write_psymbols): Use SYMBOL_SEARCH_NAME instead of SYMBOL_NATURAL_NAME in index entry. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index c482c43..7905052 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -16890,7 +16890,7 @@ write_psymbols (struct mapped_symtab *symtab, if (!*slot) { *slot = lookup; - add_index_entry (symtab, SYMBOL_NATURAL_NAME (*psymp), cu_index); + add_index_entry (symtab, SYMBOL_SEARCH_NAME (*psymp), cu_index); } } } diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 74185cc..861b302 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1305,7 +1305,7 @@ expand_symtabs_matching_via_partial || (kind == TYPES_DOMAIN && SYMBOL_CLASS (*psym) == LOC_TYPEDEF)) && (*name_matcher) (current_language, - SYMBOL_NATURAL_NAME (*psym), data)) + SYMBOL_SEARCH_NAME (*psym), data)) { PSYMTAB_TO_SYMTAB (ps); keep_going = 0;