From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id xGtIHd8PAmntlA8AWB0awg (envelope-from ) for ; Wed, 29 Oct 2025 09:00:15 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=V5ITePUN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 6B0621E0BC; Wed, 29 Oct 2025 09:00:15 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 908A41E04C for ; Wed, 29 Oct 2025 09:00:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E07303858C74 for ; Wed, 29 Oct 2025 13:00:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E07303858C74 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=V5ITePUN Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id A485C3858C56 for ; Wed, 29 Oct 2025 12:58:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A485C3858C56 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A485C3858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1761742723; cv=none; b=w2cyIb/0f39YiO8v2UDXZ8u8ranaOI7TD32FKZhFX7Of+h12Am7kJ+/BOZAb2lGsjQm7FxLsYTaTLDdFmZ1TTMRKo4piKcCh80N8g4LQ4hgLNtQ/4c3ouVPxaD+PF00wk0W0qxsaunPyO6aAKVMjYiSThC3HdJcmy7bCVBl7FuI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1761742723; c=relaxed/simple; bh=nM+OGmwNLU9SECqjhdr3ezUdA382rMG8FGrMmYk53sc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=PAOwRyMYBIkypw5g9rr+742lJNwcOLxpDs99BPi94Td4yFukLhdfzM7n2Sq8GvN/UaksH6yyuz7NZhyxNiS1OQjuU2ic9wd7KAbDb2ZOlLx8L/ID60veElt6at95U/mlojjhNVQXXSY7PHwRo9Fbwq0zz6hHP0c7yQXEEFUWo+E= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A485C3858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761742723; 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=UzbYX7y7u4UzGhi0yPmzgCGWU1S8SY9Kv6ngKWOzPhg=; b=V5ITePUNH++RJxveVKDrNgy640kL3+eq2MWMuZbB7dYNhLiCbAEmT1lIC/rVn3jTquqEna 2QugvKqIbG6BNRvoC5gBEqkK9ZCehy7LhgAbH5/RqZZjquab6ytW2AU9DPa455ab+0/XV3 pMqsrooVIhNucykwE0MSXRBzVGR3w80= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-362-10suxgeTNJWnLfnbWBknfg-1; Wed, 29 Oct 2025 08:58:42 -0400 X-MC-Unique: 10suxgeTNJWnLfnbWBknfg-1 X-Mimecast-MFC-AGG-ID: 10suxgeTNJWnLfnbWBknfg_1761742721 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 827F11808998 for ; Wed, 29 Oct 2025 12:58:41 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.96.134.120]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E784530001A2; Wed, 29 Oct 2025 12:58:39 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH v6 0/3] Introduce syntax for linker-namespace specific symbols Date: Wed, 29 Oct 2025 09:58:28 -0300 Message-ID: <20251029125831.2102647-1-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Y8QCnlJXfbWgoMfL4crkiZtNLH04Cd4xXjOm3WEVw_U_1761742721 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org This series adds support for the syntax [[N]]::foo to find symbols that belong to specific namespaces, while also making GDB's behavior more consistent when a namespace is not specified. This needs one preparatory patch and 2 patches actually implementing this feature Patch 1 is an essential fix, updating how we calculate a variable's copy relocation to take linker namespaces into account. Patches 2 and 3 implement the new syntax, adding the necessary supporting code and updating error messages when symbols can't be found - where it made sense. Changes for v6: * Rebased on master * Fixed a crash when using the [[N]]::foo syntax before starting the inferior Changes for v5: * fixed crash when getting the value of a variable before the inferior starts. * Rebased on master Changes for v4: * Fixed final documentation feedback from Eli. * Changed error message when [[N]]::foo::bar fails to find 'foo'. * Fixed build breakage. Changes for v3: * Removed previous patches 1 and 2, as Simon's recently merged patches already did those in a better way. * parser_state now also takes the current solib_ops, since that can't be obtained from gdbarch anymore. Changes for v2: * solib_supports_linker_namespaces now always expects a pointer. * Previous patches 2 and 3 were dropped. * lookup_minimal_symbol_linkage now takes an array_view. * created new tokens for [[ and ]], to ensure that [[N]] looks like that. * Fixed formatting nits from Eli. Guinevere Larsen (3): gdb: make lookup_minimal_symbol_linkage work with linker namespaces gdb: Make the parser recognize the [[N]] syntax for variables gdb: extend the [[N]]::foo syntax for files gdb/NEWS | 6 + gdb/c-exp.y | 88 +++++++++--- gdb/doc/gdb.texinfo | 6 + gdb/dwarf2/ada-imported.c | 8 +- gdb/linespec.c | 4 +- gdb/minsyms.c | 139 ++++++++++++------- gdb/minsyms.h | 17 ++- gdb/parse.c | 3 +- gdb/parser-defs.h | 39 +++++- gdb/rust-parse.c | 3 +- gdb/solib-svr4.c | 20 --- gdb/solib.c | 86 +++++++++++- gdb/solib.h | 19 +++ gdb/symtab.c | 76 ++++++++-- gdb/symtab.h | 15 +- gdb/testsuite/gdb.base/dlmopen-ns-ids-lib.c | 14 ++ gdb/testsuite/gdb.base/dlmopen-ns-ids-main.c | 3 + gdb/testsuite/gdb.base/dlmopen-ns-ids.exp | 65 +++++++++ 18 files changed, 499 insertions(+), 112 deletions(-) base-commit: 0633b78640dc892265d148f24881d544d4ddd16e -- 2.51.0