From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id xIxLFAkG9GeVcSoAWB0awg (envelope-from ) for ; Mon, 07 Apr 2025 13:06:17 -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=WbD08NdR; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 4219F1E0C3; Mon, 7 Apr 2025 13:06:17 -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 9963F1E05C for ; Mon, 7 Apr 2025 13:06:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 26F7F386EC77 for ; Mon, 7 Apr 2025 17:06:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26F7F386EC77 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=WbD08NdR 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 066593857C4F for ; Mon, 7 Apr 2025 17:05:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 066593857C4F 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 066593857C4F 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=1744045505; cv=none; b=hFx1hAkirTtFH3pgl9eT7jLBkgoYqaY1cQnAmeAoNO6bAgpm8LfC7z6tWE9MHVJObccxJEVvL1f33h1AkOAMpUlvxHnNsMhSTejFi8VvZT3QBwBZSNaeo80ZPvFsY6iPNcC7HGDRGLsJ++sBIr1HAP7X3I9uza3C8oC7hWrunkY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744045505; c=relaxed/simple; bh=HirVI4hJj+Uzj6yi4HUD70GNfV5Bm/IlqIE+8Qo1buA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=lerXjh5ddQOAGPe2rPfZJV+8fjl2t6/TCJjUxUKOkTVXjPaDVN9oPSxVs8kguCMfMK3FmBLlEuthz0GybNAqxMOpbDXttX1s10Ww75F39nDVHki0mRdcVALuQnQdghAM8rNwWtm5fgYrj0e/UNsM4UU7S4KSOFjPVLEZUj8i1Tk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 066593857C4F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744045504; 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=qb7h1lFeez1UHa9J40BfoAU7VBLV6lDUVE935aKeqLU=; b=WbD08NdR+RPAQfemlsQZUlJWaK/rm7Bh34/4DqDZTH/YWV799imCW4qA7QRZcwDzdM0D0A eSqcY14NHGhW5vj2OnmqKsnbJ6/7Sl5da+4HNA8e41eKcvPQ+xrHXWVLhIcVTNtwRAp2G/ q6NpYWAic7/AfbWyKMzaZUZRfrxcgdA= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-jyvvYWqVN7q919CyHVdngQ-1; Mon, 07 Apr 2025 13:05:02 -0400 X-MC-Unique: jyvvYWqVN7q919CyHVdngQ-1 X-Mimecast-MFC-AGG-ID: jyvvYWqVN7q919CyHVdngQ_1744045501 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6e8f9450b19so98224616d6.1 for ; Mon, 07 Apr 2025 10:05:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744045501; x=1744650301; 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=qb7h1lFeez1UHa9J40BfoAU7VBLV6lDUVE935aKeqLU=; b=ZGgzGwvxUrCioeCx+GYp4Th5rlej0Lo1m/Plah+qRjIUSY1qXQMzKcRIevL2dAJgQl J2sI6WFAf/kdxS7yOZ59nEX3FW9fTUBzpkzBS6XqL6f7+GI8hxbVvzUfToRgBpuy0Agf bxPKEjmvgC+GMVVScPj1UGsZEYoLG9Lfz8CfL2BPXO1ED9wfO1HH8+2UiiNGAT/nm5Un 7yrjFnTUQfTDMlY205ClCbf4RntQc78JLSoOmMCBIV1slZwxM0Czs26X+nZiWVxS8spb 5NvZj1DpvO1eWWAiURNviQ6cM2jlpQmcQoDVU8uoFVI4LNv68Jb14+lV6A4rjN/nvzh0 hU3g== X-Gm-Message-State: AOJu0YxQcpg6H/mtVukCJjnapI8yj6NN7GHj33Osf2GC4YkXnd2mklku mnRBqeyYzG5xwcjuQ1OfaE6mHacbztfz1hEyLYT89TNMdpw1VfZcEJrHd/RFVMKaDKuKCPPstJE L0aqhGqfgv10oU3GvyHxOvqIlmDHlqSoVW7eMBpNjxXYykdIhbmOHGgwSSUkblzhSseU= X-Gm-Gg: ASbGncsRnUtZ1bqTZ6IYM5qV34nnS0nFtRe90wcBfDUnDOnJrokXWRMQtybr8mCyIoB RHDxwxkeWDhgFKVG4QiSWoYSixVKbtGVn25omN1vsSXy06jT4ZnynjhcwUQ+Bz566xf8+UMwZTM 1WMNPPuvbSeBj7wFG72yomBrirVGd4/tkUMuLvX28jnAxtYNOdY/TntGpC50Z42j2IqERJkf4d0 pW8SLqoORdEyDJSQ+uD/A6JXSApZx4ZlvLn/mpIoaYHYxlvqHkwnN93V0bvImKkZktiU4+k1iyC Nh18l9Is8m2EosAcrk3ttCwK6LM= X-Received: by 2002:a05:6214:498a:b0:6ed:1095:e9cc with SMTP id 6a1803df08f44-6f0d250aea4mr4187286d6.8.1744045501361; Mon, 07 Apr 2025 10:05:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6Rgb4EEb5X7SEoK6VhvhXZC2KLKqWo9e8+lYPVQkY7jlQG0VF6PE+a1zX10L8Nte2yTITIg== X-Received: by 2002:a05:6214:498a:b0:6ed:1095:e9cc with SMTP id 6a1803df08f44-6f0d250aea4mr4186846d6.8.1744045501037; Mon, 07 Apr 2025 10:05:01 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:9a69::1003? ([2804:14d:8084:9a69::1003]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ef0f00ee55sm60866226d6.32.2025.04.07.10.04.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Apr 2025 10:05:00 -0700 (PDT) Message-ID: <9c4db6df-fdae-4c3d-89b7-e840dcf30cba@redhat.com> Date: Mon, 7 Apr 2025 14:04:58 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] GDB: Introduce "info namespaces" command To: Eli Zaretskii Cc: gdb-patches@sourceware.org References: <20250407145443.1895323-1-guinevere@redhat.com> <20250407145443.1895323-4-guinevere@redhat.com> <86ldsct1ou.fsf@gnu.org> From: Guinevere Larsen In-Reply-To: <86ldsct1ou.fsf@gnu.org> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: UMOKIxziYJzB0O6cMAn2oggsZ3IaxejR3Sq_pygHzvU_1744045501 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:45 PM, Eli Zaretskii wrote: >> From: Guinevere Larsen >> Cc: Guinevere Larsen >> Date: Mon, 7 Apr 2025 11:54:43 -0300 >> >> Continuing to improve GDB's ability to debug linker namespaces, this >> commit adds the command "info namespaces". The command is similar to >> "info sharedlibrary" but focused on improved readability when the >> inferior has multiple linker namespaces active. This command can >> be used in 2 different ways, with or without an argument. >> >> When called without argument, the command will print the number of >> namespaces, and for each active namespace, it's identifier, how many >> libraries are loaded in it, and all the libraries (in a similar table to >> what "info sharedlibrary" shows). As an example, this is what GDB's >> output could look like: >> >> (gdb) info namespaces >> There are 2 namespaces loaded >> There are 3 libraries loaded in namespace [[0]] >> Displaying libraries for namespace [[0]]: >> From To Syms Read Shared Object Library >> 0x00007ffff7fc6000 0x00007ffff7fff000 Yes /lib64/ld-linux-x86-64.so.2 >> 0x00007ffff7ebc000 0x00007ffff7fa2000 Yes (*) /lib64/libm.so.6 >> 0x00007ffff7cc9000 0x00007ffff7ebc000 Yes (*) /lib64/libc.so.6 >> (*): Shared library is missing debugging information. >> >> There are 4 libraries loaded in namespace [[1]] >> Displaying libraries for namespace [[1]]: >> From To Syms Read Shared Object Library >> 0x00007ffff7fc6000 0x00007ffff7fff000 Yes /lib64/ld-linux-x86-64.so.2 >> 0x00007ffff7fb9000 0x00007ffff7fbe000 Yes gdb.base/dlmopen-ns-ids/dlmopen-lib.so >> 0x00007ffff7bc4000 0x00007ffff7caa000 Yes (*) /lib64/libm.so.6 >> 0x00007ffff79d1000 0x00007ffff7bc4000 Yes (*) /lib64/libc.so.6 >> (*): Shared library is missing debugging information. >> >> When called with an argument, the argument must be a namespace >> identifier (either with or without the square brackets decorators). In >> this situation, the command will truncate the output to only show the >> relevant information for the requested namespace. For example: >> >> (gdb) info namespaces 0 >> There are 3 libraries loaded in namespace [[0]] >> Displaying libraries for namespace [[0]]: >> From To Syms Read Shared Object Library >> 0x00007ffff7fc6000 0x00007ffff7fff000 Yes /lib64/ld-linux-x86-64.so.2 >> 0x00007ffff7ebc000 0x00007ffff7fa2000 Yes (*) /lib64/libm.so.6 >> 0x00007ffff7cc9000 0x00007ffff7ebc000 Yes (*) /lib64/libc.so.6 >> (*): Shared library is missing debugging information. >> >> The test gdb.base/dlmopen-ns-id.exp has been extended to test this new >> command. >> --- >> gdb/NEWS | 5 ++ >> gdb/doc/gdb.texinfo | 15 ++++ >> gdb/solib-svr4.c | 49 ++++++++++++ >> gdb/solib.c | 91 ++++++++++++++++++++++ >> gdb/solist.h | 4 + >> gdb/testsuite/gdb.base/dlmopen-ns-ids.exp | 93 +++++++++++++++++++++++ >> 6 files changed, 257 insertions(+) > Thanks. > >> +info namespaces >> +info namespaces [[N]] >> + Print information about the given namespace (identified as N), or about >> + all the namespaces if no argument is given. > This part is okay. > >> +@table @code >> +@item info namespaces > No @kindex? Thanks for the quick review! I didn't use @kindex because I didn't know what it was used for, and didn't accidentally put my command into an unrelated list somehow. I fixed this and everything else pointed out in this review! -- Cheers, Guinevere Larsen She/Her/Hers > >> +@item info namespaces @code{[[N]]} > N is a meta-syntactic variable, so please use @var{n} for it. > >> +With no argument, print the number of linker namespaces which are >> +currently active - that is, namespaces that have libraries loaded > ^ > Please use either "--" or "---" to produce an em-dash or en-dash. > >> +on them. Then, it prints the number of libraries loaded into each > ^^^^^^^ > "into them", right? > >> +If an argument is provided, only prints the library count and table >> +for the provided namespace.K The surrounding square brackets are > "If an argument @code{[[@var{n}]]} is provided, only prints the > library count and the libraries for the specified namespace @var{n}." > > Reviewed-By: Eli Zaretskii >