From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24595 invoked by alias); 25 Mar 2014 18:11:53 -0000 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 Received: (qmail 24526 invoked by uid 89); 25 Mar 2014 18:11:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Mar 2014 18:11:51 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2PIBX1R021810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 Mar 2014 14:11:44 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2PHLHvY008224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 25 Mar 2014 13:21:18 -0400 Message-ID: <5331BB0D.4010606@redhat.com> Date: Tue, 25 Mar 2014 18:11:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Joel Brobecker CC: "gp >> \"gdb-patches@sourceware.org ml\"" Subject: Re: [RFA] Fix c++/16253 (tag/variable name collision) References: <532C810F.7010809@redhat.com> <20140324141527.GM4282@adacore.com> In-Reply-To: <20140324141527.GM4282@adacore.com> Content-Type: multipart/mixed; boundary="------------050706020605080801040000" X-IsSubscribed: yes X-SW-Source: 2014-03/txt/msg00599.txt.bz2 This is a multi-part message in MIME format. --------------050706020605080801040000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 765 On 03/24/2014 07:15 AM, Joel Brobecker wrote: > This may not be directly related to your patch. I seem to have seen > some unexplainable behavior in GDB occasionally in the recent past > making me wonder whether there might be something fishy in the symbol > lookup for Ada. It is my patch that is causing the problems. In this case, add_nonlocal_symbols is calling the qf map_matching_symbols method which is calling match_partial_symbol. Since this method now does strict matches against domain, an explicit check for STRUCT_DOMAIN matches must be added. Give this amendment a shot and see how it goes. I suspect there are probably one or two more places where this occurs. [The easiest thing to do is audit any function which uses "VAR_DOMAIN".] Keith --------------050706020605080801040000 Content-Type: text/x-patch; name="16253-amended-1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="16253-amended-1.patch" Content-length: 1444 diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 00728bf..94c6cf8 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5336,13 +5336,33 @@ add_nonlocal_symbols (struct obstack *obstackp, const char *name, data.objfile = objfile; if (is_wild_match) - objfile->sf->qf->map_matching_symbols (objfile, name, domain, global, - aux_add_nonlocal_symbols, &data, - wild_match, NULL); + { + objfile->sf->qf->map_matching_symbols (objfile, name, domain, global, + aux_add_nonlocal_symbols, + &data, wild_match, NULL); + if (domain == VAR_DOMAIN) + { + objfile->sf->qf->map_matching_symbols (objfile, name, + STRUCT_DOMAIN, global, + aux_add_nonlocal_symbols, + &data, wild_match, NULL); + } + } else - objfile->sf->qf->map_matching_symbols (objfile, name, domain, global, - aux_add_nonlocal_symbols, &data, - full_match, compare_names); + { + objfile->sf->qf->map_matching_symbols (objfile, name, domain, global, + aux_add_nonlocal_symbols, + &data, full_match, + compare_names); + if (domain == VAR_DOMAIN) + { + objfile->sf->qf->map_matching_symbols (objfile, name, + STRUCT_DOMAIN, global, + aux_add_nonlocal_symbols, + &data, full_match, + compare_names); + } + } } if (num_defns_collected (obstackp) == 0 && global && !is_wild_match) --------------050706020605080801040000--