From patchwork Wed Oct 26 15:50:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 55244 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7C6403885533 for ; Wed, 26 Oct 2022 15:59:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C6403885533 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666799944; bh=JTnU/9+CcKn1A7mGoJhLUOf9Ho6rNQsvWXsf0HicJ5g=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=hycrHst24mCIh+A1bcZqwf+6h2fJq69r+bO2bJj/2hf7nFwhOzu2UE0wtLV5Qz8zD aNl1Nn+RES8u+21SEo4h6tDiFK0FjCcokG2wMN29PNqsjlutoR70MT2utF/nH1qMbu 56xD8lb4nW1vImLnZkj4uGUQp3EKLN23uW0ZqpgI= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 38FCB3883032 for ; Wed, 26 Oct 2022 15:57:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 38FCB3883032 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-414-H40M7ppoOeC18_mZCNw9Rg-1; Wed, 26 Oct 2022 11:57:35 -0400 X-MC-Unique: H40M7ppoOeC18_mZCNw9Rg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AA4983826A48 for ; Wed, 26 Oct 2022 15:57:35 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.33.155]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1CCE7111F3B6; Wed, 26 Oct 2022 15:57:35 +0000 (UTC) To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH 0/2] Improve handling of using directives Date: Wed, 26 Oct 2022 17:50:52 +0200 Message-Id: <20221026155053.3394792-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Bruno Larsen via Gdb-patches From: Guinevere Larsen Reply-To: Bruno Larsen Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This series tries to fix two of the main issues I saw when trying to get gdb.cp/nsusing.exp working with clang. The first issue was that GDB wouldn't care about when the 'using' directive happened in the code, even if we were stopped before it, it was considered valid. The second was that GDB would find the first reasonable variable in the imported declarations and leave early, not caring about whether that variable was ambiguous or not. Each of my patches fixes one of those issues. Bruno Larsen (2): gdb/c++: validate 'using' directives based on the current line gdb/c++: Detect ambiguous variables in imported namespaces gdb/cp-namespace.c | 50 +++++++++++++++++++++++++++----- gdb/dwarf2/read.c | 30 ++++++++++++++++++- gdb/namespace.c | 26 +++++++++++++++++ gdb/namespace.h | 14 ++++++++- gdb/testsuite/gdb.cp/nsusing.cc | 3 +- gdb/testsuite/gdb.cp/nsusing.exp | 27 +++++++++++++++-- 6 files changed, 137 insertions(+), 13 deletions(-)