From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id b9PBOEUH9GcNcyoAWB0awg (envelope-from ) for ; Mon, 07 Apr 2025 13:11:33 -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=g3lJkzj5; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D9CDB1E0C3; Mon, 7 Apr 2025 13:11:33 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.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 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 6C55D1E05C for ; Mon, 7 Apr 2025 13:11:33 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0A5ED3842FD4 for ; Mon, 7 Apr 2025 17:11:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A5ED3842FD4 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=g3lJkzj5 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 6F4053858C60 for ; Mon, 7 Apr 2025 17:11:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6F4053858C60 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 6F4053858C60 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=1744045861; cv=none; b=WHR9nN9U141TFUxytxFxipKwm5c695GLMjJT6Gi0m5YERc7ENkhO4WmP+TjOwxboRL6CxMaHi1q1lDQjXxK47OVP4N9evFN4HC8MHkFtPn2UNs3Zuk4WS7da/AOlZ5wFhKq15PEbS8I4wsrn4RROhafU8IQGGZbjJEtgIWFDToY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744045861; c=relaxed/simple; bh=vxVhLMmqcKsgdS9bDAYRbC8FKmvPTOi+vMz3BEIDOos=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=JSLR+fN8qXyYcQXMQcQvZ9SV0DkuCzpeF5f/y9XN69BMlQ0WZgL4wVnt/kGsTnCr4IwN7qpr3680Kc9iMg25iU+g+7PGjG2p0W3xjpKr/WSvYhPTGpi5h/InKcTJOzoN+lhhjkwP3f/DnIrlB12R30+APGWFtdQ9HNsyRDSdhgU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F4053858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744045861; 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: in-reply-to:in-reply-to:references:references; bh=HUIUsihp7x+16f9f9hM09nAw5wZ/641f0daPzl1tcIo=; b=g3lJkzj5/r+4OLNa/AYpJc7yU076Kj0xAjhLBSUHG/Cl5OIbtCk0ntOQhgzPJSFzQO4UJQ GZdoaHeFQzfYFhYkhCsfx0us4fCi/3cZ3pR6yWY+D6TAlpcSbtpK7LhwTz8XVFQsh+gmpr UFvUp3OadUx7mHJ4orTARZ9RFh8kgdk= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-263-Z0uVHjXOPamB9aXTOf5xlg-1; Mon, 07 Apr 2025 13:10:55 -0400 X-MC-Unique: Z0uVHjXOPamB9aXTOf5xlg-1 X-Mimecast-MFC-AGG-ID: Z0uVHjXOPamB9aXTOf5xlg_1744045854 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7c572339444so750341485a.3 for ; Mon, 07 Apr 2025 10:10:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744045854; x=1744650654; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HUIUsihp7x+16f9f9hM09nAw5wZ/641f0daPzl1tcIo=; b=OGWw/eB2pz4f25HN3txYwHddqqhQ9kpfAZPWEnXLzVyHMWJ9aAHSzRB24FfJ/fXLm7 P3nvJgA60tF2xTOOVuopCQ0/O1VB57H+Cc9DHmn9hTlLeABE+bWmmRJirqSY6FXRXPcS 8BTj0D9VHQO+zo6jBGGn8vBrhPdee3CmCw231VJK16DRbxPom1upBO9+dRIiCSrZGqpd Y4cKaBoXM+kTb+Cr0YtKGLWqnbWTsAIlmJP4IYNSTK5vhBvclGSqKU/MfXadPCS+HEii V47WIpHsOJIcbg0cGeEWhB9P1eXZLHPLF9G9Og8RkgLDmBhqmzG2jxap0R4H1vBmWxmv 5tEA== X-Gm-Message-State: AOJu0YyKFsDZIERjR+V4r8YjxPB6V2t6xsC2IV6zfNC1Yu5OfKySnexn 8cvmD64VDAzMgoxKpCuk19jq5KY8ydE/DGhrslVha73icQjIUsvmfJnxjBxThjQks2V2j7rmOHc tkXCtlW8DFiss3ncUgFSxY+figeXyjzT6SDTxS4eM7B8MPLJbdcirbmKay+ngHyGhJY4= X-Gm-Gg: ASbGncs0w//tj/ckJWHqZBpLZ3sBRu836EumuQKbaaxaHNyKHGQfP45ubp6l7yL1eVS /kdy3/tMKvk1uyR4NLFafrXiWrKpDf7U2TS/ngNLtIVV/rD90je7xeR+Tkf+JP07UBtDDh/TMgu y7DRoQf+oUuOjDkgDgLL5oMm0xRTWYQXzIKfrS9gzpVOkBJ5/2wH4YdXpw4WUX8FFuq+0Now/to xarH5NM0ROruCUcagJ2lsFDg0g4N2e4OZoO1ghwlif1Xzqi6q1FBiqv/AezHaFUQMi4D5yJvgcX jfAsl8kTStu3zpCSUL1euoZza3c= X-Received: by 2002:a05:620a:6001:b0:7c5:47c6:b87f with SMTP id af79cd13be357-7c77dd86845mr1494110685a.19.1744045854389; Mon, 07 Apr 2025 10:10:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHhXIIhgJ+FOCyt1PcmfirN131anzshoe31xHT9mv3LQAlJbiys95AgTy/LaM8XZH88+BVUw== X-Received: by 2002:a05:620a:6001:b0:7c5:47c6:b87f with SMTP id af79cd13be357-7c77dd86845mr1494108085a.19.1744045854036; Mon, 07 Apr 2025 10:10:54 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:9a69::1003? ([2804:14d:8084:9a69::1003]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c76ea58d71sm623963785a.89.2025.04.07.10.10.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Apr 2025 10:10:53 -0700 (PDT) Message-ID: <9803a8a5-390a-4900-b0bb-13fe55373573@redhat.com> Date: Mon, 7 Apr 2025 14:10:51 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] gdb: add convenience variables around linker namespace debugging To: Eli Zaretskii Cc: gdb-patches@sourceware.org References: <20250407145443.1895323-1-guinevere@redhat.com> <20250407145443.1895323-2-guinevere@redhat.com> <86mscst1yr.fsf@gnu.org> From: Guinevere Larsen In-Reply-To: <86mscst1yr.fsf@gnu.org> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 9advTOhokri8kawJXrVVrFhxk4gSFcsMSkQx_ErPRlk_1744045854 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 4/7/25 12:39 PM, Eli Zaretskii wrote: >> From: Guinevere Larsen >> Cc: Guinevere Larsen >> Date: Mon, 7 Apr 2025 11:54:41 -0300 >> >> This commit adds 2 simple built-in convenience variables to help users >> debug an inferior with multiple linker namespaces. The first is >> $_active_namespaces, which just counts how many namespaces have SOs >> loaded onto them. The second is $_current_namespace, and it tracks which >> namespace does the current location in the inferior belongs to. >> >> This commit also introduces a test ensuring that we track namespaces >> correctly, and that a user can use the $_current_namespace variable to >> set a conditional breakpoint, while linespec changes aren't finalized to >> make it more convenient. >> --- >> gdb/NEWS | 5 ++ >> gdb/doc/gdb.texinfo | 12 +++++ >> gdb/solib-svr4.c | 6 +++ >> gdb/solib.c | 42 +++++++++++++++ >> gdb/testsuite/gdb.base/default.exp | 2 + >> gdb/testsuite/gdb.base/dlmopen-ns-ids-main.c | 6 +++ >> gdb/testsuite/gdb.base/dlmopen-ns-ids.exp | 55 ++++++++++++++++++++ >> 7 files changed, 128 insertions(+) > Thanks. > >> --- a/gdb/NEWS >> +++ b/gdb/NEWS >> @@ -40,6 +40,11 @@ >> namespace into which the library was loaded, if more than one namespace >> is active. >> >> +* New built-in convenience variables $_active_namespaces and >> + $_current_namespace. These show the number of active linkage namespaces, >> + and which one the current location belongs to. In systems that don't > ^^ > Two spaces there, please. > > Also, I find the following minor rewording easier to grasp: > > These show the number of active linkage namespaces, and the > namespace to which the current location belongs. > >> +@item $_active_namespaces >> +@vindex $_active_namespaces@r{, convenience variable} > Please always put the indexing commands _before_ the @item which they > index, so that the corresponding command in the Info reader moves the > cursor to the @item and not after it. > >> +@item $_current_namespace >> +@vindex $_current_namespace@r{, convenience variable} > Likewise. > >> +Which namespace contains the current location in the inferior. > "The namespace which contains the current location in the inferior." > >> This returns >> +GDB's internal identifier for namespaces, which is @samp{[[]]} with an >> +integer in the middle. > It is better to show than to describe: > > This returns @value{GDBN}'s internal identifier for namespaces, > which is @samp{[[@var{n}]]}, where @var{n} is a zero-based namespace > number. > > Reviewed-By: Eli Zaretskii > Thanks for the review, I applied all the fixes and your tag -- Cheers, Guinevere Larsen She/Her/Hers