From patchwork Tue Mar 25 17:21:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Seitz X-Patchwork-Id: 277 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (caibbdcaabja.dreamhost.com [208.113.200.190]) by wilcox.dreamhost.com (Postfix) with ESMTP id 096AF3600C8 for ; Tue, 25 Mar 2014 11:11:56 -0700 (PDT) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14314964) id ADD9661F5F754; Tue, 25 Mar 2014 11:11:56 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx23.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx23.g.dreamhost.com (Postfix) with ESMTPS id 88D2C61EE0719 for ; Tue, 25 Mar 2014 11:11:56 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; q=dns; s=default; b= Hlzz+8ISvoiFiDB4FYu4k844rz22EtOfFEkQFQLH84+LNZp1jYr5O7k8B1XCY+40 SZq/eyAGWNOpc9bvKyCyJMUJqxOf5Axp6o/ZyJGtZ60N/tbpKUUySyb48TIVa9T9 SP5iTogcBOHJ+4stBTP2OBsTvVq8JwvbrS6RJjCzayw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; s=default; bh=HYE3 2widC1/FZXZpMKNySfICG8E=; b=wac8tBAm6+HCJpbvTkfnRa5ZpKfAkZ36McMq AhLrRHc+xzCZFwSCG2fVuz+LVt3gUVFAL6vq6ii1bkGoKxolzyGYsOTbZfCwN1a/ mt+0cH6I9EhK17YE4nExuFdK3MibNXRmR/4+l4c7rcZ4C6B5r2c4omLKGhTv9E8X fRZLC/E= 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-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@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 10:21:17 -0700 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> X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in 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 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)