From: Eli Zaretskii <eliz@gnu.org>
To: Guinevere Larsen <guinevere@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] gdb: add convenience variables around linker namespace debugging
Date: Mon, 07 Apr 2025 18:39:56 +0300 [thread overview]
Message-ID: <86mscst1yr.fsf@gnu.org> (raw)
In-Reply-To: <20250407145443.1895323-2-guinevere@redhat.com> (message from Guinevere Larsen on Mon, 7 Apr 2025 11:54:41 -0300)
> From: Guinevere Larsen <guinevere@redhat.com>
> Cc: Guinevere Larsen <guinevere@redhat.com>
> 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 <eliz@gnu.org>
next prev parent reply other threads:[~2025-04-07 15:40 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 [this message]
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
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=86mscst1yr.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