From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id EA9983858C54 for ; Tue, 22 Nov 2022 11:51:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EA9983858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669117862; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OIi165bCaRAh7PSUS8lCIo5LxLKq6hafNcptgvkOgFY=; b=ZR5wIfiCQ/G4UHhb5j8iKgQ+r9lXXfe+OmFoCJuKOTOOBm4vxTeGduk1JbfgH8H04AdfgY lPUoudpwfGU8WnMr6F1uwRdm4DqyN6SfLepeAk94myNZ005GS8JubPtmrisdefdOtIyiGb ajD/3pBVkfclMmWx0SkG6K6i4I44HPM= 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-381-KUqu4s9PMkyZNypZDvoHzg-1; Tue, 22 Nov 2022 06:51:01 -0500 X-MC-Unique: KUqu4s9PMkyZNypZDvoHzg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B2A283C0F663 for ; Tue, 22 Nov 2022 11:51:00 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.105]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3E0381415102; Tue, 22 Nov 2022 11:51:00 +0000 (UTC) From: Bruno Larsen To: gdb-patches@sourceware.org Cc: Bruno Larsen Subject: [PATCH v3 0/2] Improve handling of using directives Date: Tue, 22 Nov 2022 12:33:18 +0100 Message-Id: <20221122113319.1760546-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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_LOW,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 List-Id: 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. Changelog for v3: * changed map key to use std::string, so we get an ordered output. * Improved documentation on some spots * Fix bug where gdb could return a partial list of the ambiguous symbols Changelog for v2: * factored out some code to avoid unnecessary repetition. * made it so ambiguous variables are explicitly reported * fixed formatting 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 | 99 ++++++++++++++++++++++++-------- gdb/dwarf2/read.c | 30 +++++++++- gdb/namespace.c | 25 ++++++++ gdb/namespace.h | 16 +++++- gdb/testsuite/gdb.cp/nsusing.cc | 3 +- gdb/testsuite/gdb.cp/nsusing.exp | 25 +++++++- 6 files changed, 167 insertions(+), 31 deletions(-) -- 2.38.1