From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id lqUkNPFRVGjG3hQAWB0awg (envelope-from ) for ; Thu, 19 Jun 2025 14:07:45 -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=ehXBp1Yt; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C230D1E11C; Thu, 19 Jun 2025 14:07:45 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-10.1 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, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE 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 3898F1E089 for ; Thu, 19 Jun 2025 14:07:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 995A93874C0C for ; Thu, 19 Jun 2025 18:07:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 995A93874C0C 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=ehXBp1Yt 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 8B30A3858039 for ; Thu, 19 Jun 2025 18:05:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B30A3858039 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 8B30A3858039 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750356356; cv=none; b=Of1aQrj1B7KYmK22Mu5M+C+jCiS2ud15A+ruChZ0HR9wFEUpsH/v+UN2Cfz3QjAKvroDWiqAigKiA1iYggU8QtB9PLc8ChG9uN5Gy8LCGO3cUw4yeVCZWDuK/5BqHMtxNHTqL6/anYmJU4c06yppze4mqU20FPGaHVgVxevfbYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750356356; c=relaxed/simple; bh=ded58r+oEeexkvclWqLJTjOT2RmrU+pih//1Gg5X92E=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=c2qhMQIzwAzJhuksf2mReduWaL9WMs4uEWllXT5B62pdfAVw70F6ZBC0Zbto3Jzjjp8S7E+HnK+TlFVSwNhNppVArnQ5mNcfuRFAG3Kb88aVk90c8m+NNPSNWQpz8XhEC21FcoHO/IsIYpF0KYAgQEPdUyC7Of2Kt4HxJ3M3So0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B30A3858039 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1750356355; 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=z9+TWMMSxqSBj/+PuN4cpzBI2cgqHpaybFAUgtKz4z0=; b=ehXBp1YtviPTQh0L5RMQshJHuzlzIxdAQ4+forthu3+PxQ7UYydvYuA4T8k+cuiI+dkFCU 5phMsAHF3Hxk5R3NQ5S82Xz+TCKPTy4K0oZw6461j/nuIaH+4N7/CTGlm4mt5FEryPTwE7 +qU40pxSRgyCZt6YIG4VvzAVRAEBKUs= 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-211-8zJOYuoZNBmoynpUWZdcsw-1; Thu, 19 Jun 2025 14:05:54 -0400 X-MC-Unique: 8zJOYuoZNBmoynpUWZdcsw-1 X-Mimecast-MFC-AGG-ID: 8zJOYuoZNBmoynpUWZdcsw_1750356353 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 A00851800284 for ; Thu, 19 Jun 2025 18:05:53 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.96.134.45]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4A82618003FC; Thu, 19 Jun 2025 18:05:51 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH v3 0/3] Introduce syntax for linker-namespace specific symbols Date: Thu, 19 Jun 2025 15:05:37 -0300 Message-ID: <20250619180540.2315103-1-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ELzqJ45f1EnglE1lSzjw8c61pdoLRIP53KVElHgzAVE_1750356353 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. Do note that this series is built on top Simon's recent C++ification of the solib_ops class, since it has better solutions to some problems than my old versions. It should be reviewed with that series in mind. 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 | 82 ++++++++--- gdb/doc/gdb.texinfo | 6 + gdb/dwarf2/ada-imported.c | 8 +- gdb/linespec.c | 4 +- gdb/minsyms.c | 135 ++++++++++++------- gdb/minsyms.h | 17 ++- gdb/parse.c | 3 +- gdb/parser-defs.h | 37 ++++- gdb/rust-parse.c | 3 +- gdb/solib-svr4.c | 20 --- gdb/solib.c | 82 ++++++++++- gdb/solib.h | 19 +++ gdb/symtab.c | 74 +++++++++- 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 | 54 ++++++++ 18 files changed, 473 insertions(+), 109 deletions(-) -- 2.49.0