Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Guinevere Larsen <guinevere@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 3/3] GDB: Introduce "info namespaces" command
Date: Mon, 07 Apr 2025 18:45:53 +0300	[thread overview]
Message-ID: <86ldsct1ou.fsf@gnu.org> (raw)
In-Reply-To: <20250407145443.1895323-4-guinevere@redhat.com> (message from Guinevere Larsen on Mon, 7 Apr 2025 11:54:43 -0300)

> From: Guinevere Larsen <guinevere@redhat.com>
> Cc: Guinevere Larsen <guinevere@redhat.com>
> 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 <eliz@gnu.org>

  reply	other threads:[~2025-04-07 15:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 14:54 [PATCH 0/3] Add some linker namespaces conveniences Guinevere Larsen
2025-04-07 14:54 ` [PATCH 1/3] gdb: add convenience variables around linker namespace debugging Guinevere Larsen
2025-04-07 15:39   ` Eli Zaretskii
2025-04-07 17:10     ` Guinevere Larsen
2025-04-07 14:54 ` [PATCH 2/3] gdb: factor out printing a table of solibs for info sharedlibrary Guinevere Larsen
2025-04-07 14:54 ` [PATCH 3/3] GDB: Introduce "info namespaces" command Guinevere Larsen
2025-04-07 15:45   ` Eli Zaretskii [this message]
2025-04-07 17:04     ` Guinevere Larsen
2025-04-07 18:08 ` [PATCH 0/3] Add some linker namespaces conveniences Kevin Buettner
2025-04-09 20:20   ` Guinevere Larsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ldsct1ou.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=guinevere@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox