| Message ID | 20260601192251.60958-1-guinevere@redhat.com |
|---|---|
| Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C277F4BA2E29 for <patchwork@sourceware.org>; Mon, 1 Jun 2026 19:23:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C277F4BA2E29 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=OzMQN0ea 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.129.124]) by sourceware.org (Postfix) with ESMTP id C39344BA2E2C for <gdb-patches@sourceware.org>; Mon, 1 Jun 2026 19:23:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C39344BA2E2C 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 C39344BA2E2C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780341782; cv=none; b=Vn/ej16BwU941900jDTwPzurWAL1vzP5q4rVNV2k7UvgPjNv5FaDYK5MOKeL/DfWDPkynlafM06HcPWEMxb84eTiiBUEPYG7iR9dcE38/m154YAKvkc94AbyQtiDaWJ+VAlifGbhvRIhJg5lAPGXZ6phS1Ej5Lf2DWp5I4Lo/tc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1780341782; c=relaxed/simple; bh=9CL+rx2tHICHwt76pRhk0dV+C9AMh1P81jBMv5UDtdY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=YRP3RHsFNgfhnpCfLADw99z7GiMVp0UW/TftkCokzAMWuYgN8npi4UFUL15fouIzcEvDPOuHYPr5EuRp7imE7NYBX/I0Nfy+3R563x8V2rEkKXrWAt+1/AD+sJ2jWanqc1TjnqtxKDnS4UBXzfbvCHVRySfsuHYGclSx7A55e1A= ARC-Authentication-Results: i=1; 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=OzMQN0ea DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C39344BA2E2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780341782; 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=Ml6XW7jvR+M/QrdR2gQCD2keh2MygSt8Jcfxfxw1NCM=; b=OzMQN0ea5a+4oeALeFhpvguwHINFEHX7pdtLLbxvBRphFlFkHwF9HocyM/04fOdXgmUEvI EAYOO7ByHl7mJ5SJwLV9B1mreFe+m4PIKObOM82dQTOoi//MYNUkaWyvtoGnSwk0cALQ3N /M4X/yXqSGfVduQFV/GVvIALzBb/zUs= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-ph5nC7sOPVOcyTnJKu9sZA-1; Mon, 01 Jun 2026 15:23:01 -0400 X-MC-Unique: ph5nC7sOPVOcyTnJKu9sZA-1 X-Mimecast-MFC-AGG-ID: ph5nC7sOPVOcyTnJKu9sZA_1780341780 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9501519560A3 for <gdb-patches@sourceware.org>; Mon, 1 Jun 2026 19:23:00 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.96.134.144]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6DA9B19560A3; Mon, 1 Jun 2026 19:22:59 +0000 (UTC) From: Guinevere Larsen <guinevere@redhat.com> To: gdb-patches@sourceware.org Cc: Guinevere Larsen <guinevere@redhat.com> Subject: [PATCH v7 0/5] Introduce syntax for linker-namespace specific symbols Date: Mon, 1 Jun 2026 16:22:46 -0300 Message-ID: <20260601192251.60958-1-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 1FbxPhWp6EJGJlqRTs15DpXgs6WsIBQjulSm7amszFk_1780341780 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-2.8 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_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_PASS, SPF_NONE, TXREP shortcircuit=no autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
Introduce syntax for linker-namespace specific symbols
|
|
Message
Guinevere Larsen
June 1, 2026, 7:22 p.m. UTC
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 2 preparatory patches and 2 patches actually implementing this feature, and one final patch to make symtab searching more consistent with the [[N]]::foo syntax. Patch 1 is a small refactor, creating a function to figure out the current linker namespace. Patch 2 is an essential fix, updating how we calculate a variable's copy relocation to take linker namespaces into account. Patches 3 and 4 implement the new syntax, adding the necessary supporting code and updating error messages when symbols can't be found - where it made sense. Patch 5 is a small change to the find_symtab function, to prefer symtabs from the current linker namespace. Changes for v7: * Added 2 new patches to the series, one to solve Andrew's feedback and another to fix an inconsistency I found. * Minor cosmetic fixes * rebased on master 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 (5): gdb: Create helper function for the current namespace 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: prefer symtabs for the current linker namespace gdb/NEWS | 5 + gdb/c-exp.y | 93 ++++++++++--- gdb/doc/gdb.texinfo | 6 + gdb/dwarf2/ada-imported.c | 8 +- gdb/linespec.c | 4 +- gdb/minsyms.c | 137 ++++++++++++------- gdb/minsyms.h | 21 ++- gdb/parse.c | 3 +- gdb/parser-defs.h | 50 ++++++- gdb/rust-parse.c | 3 +- gdb/solib-svr4.c | 20 --- gdb/solib.c | 108 +++++++++++++-- gdb/solib.h | 29 ++++ gdb/symtab.c | 94 +++++++++++-- gdb/symtab.h | 12 +- gdb/testsuite/gdb.base/dlmopen-ns-ids-lib.c | 14 ++ gdb/testsuite/gdb.base/dlmopen-ns-ids-main.c | 8 ++ gdb/testsuite/gdb.base/dlmopen-ns-ids.exp | 83 +++++++++++ 18 files changed, 570 insertions(+), 128 deletions(-) base-commit: 909db30adab1688870e978c85d014d4a36641f4e