From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ZG3zC1vz82dGYCoAWB0awg (envelope-from ) for ; Mon, 07 Apr 2025 11:46:35 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=QpNpYTUz; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 207EC1E0C3; Mon, 7 Apr 2025 11:46:35 -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 96EAA1E05C for ; Mon, 7 Apr 2025 11:46:34 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 32925384587A for ; Mon, 7 Apr 2025 15:46:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32925384587A Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=QpNpYTUz Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id DACBE3845864 for ; Mon, 7 Apr 2025 15:46:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DACBE3845864 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DACBE3845864 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744040761; cv=none; b=hmdpEPlvmpV+FoQMecNsIRsD4viqYSvbocNqqjfjReQDnBsaWoINqWpZhMCTFx5cBWLldC/4O6C3qWKJOPlKoYTIGkchfjdqvP7eLQdhG9lqBiHY9yPo7wBlzCF1qzUfu8FG9cNKcu/zYUkCKqhaB2eIdHMaO/VUZsH9WZaiqFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744040761; c=relaxed/simple; bh=faMcuMx8wdmrx7huvJqtLKcJLOpUvrE0qFfUe12MboY=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=o0B6tsqBsGSLedRjnyYKYH2Gk/e9XqvNJV0q2Xkwfc0aW/O4UTN2ATaxfFBbC9oq/wrAntE+rzAGJXeg+DmBqQC9TfSliUCIadSMaAWWfCZxZ5Qmjcawqls+7aQATIW5zD9ZYBeV3DFaV4g4AdZM+FumnCbxAz/w7hqrUpw7YM8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DACBE3845864 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u1ofh-0003AF-60; Mon, 07 Apr 2025 11:46:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3sVIk6goerhsumpF5zpR+szA0L+8crOfBO2bDG5BWh8=; b=QpNpYTUzPOxP qbuNHSBci9S2QeLMj+56ba7S/b9k0t7sbI5VLjb3xvhwySvTIrL58hDFgX3xyjkugj6IZlpD4+5w3 mpYahxUa4jDT/73RcRkHExlK1wUHmUKkW4oGiEKixBLlm8WGKWeQIWfcFTH93Wd5KSmX86eE/Qrm4 obRtZrHuS0qUODbnNf6LG9UyMKhfrfL9XsWjXGI+MlSeV5ITg3Fkn8V0lWcMMKgoT7pkiLkiG5f7z TI5bDdyRJcRZJdCSjbj4deFMwJUIFDoCApTA+SUrcmghllNJ/p5a7DExz5NdjjmhXdj0IJjj6JSHY g5PmvZuoOWhlqrik8s3ZRw==; Date: Mon, 07 Apr 2025 18:45:53 +0300 Message-Id: <86ldsct1ou.fsf@gnu.org> From: Eli Zaretskii To: Guinevere Larsen Cc: gdb-patches@sourceware.org In-Reply-To: <20250407145443.1895323-4-guinevere@redhat.com> (message from Guinevere Larsen on Mon, 7 Apr 2025 11:54:43 -0300) Subject: Re: [PATCH 3/3] GDB: Introduce "info namespaces" command References: <20250407145443.1895323-1-guinevere@redhat.com> <20250407145443.1895323-4-guinevere@redhat.com> 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 > 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? > +@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