From: Eli Zaretskii <eliz@gnu.org>
To: Craig Blackmore <craig.blackmore@embecosm.com>
Cc: gdb-patches@sourceware.org, aburgess@redhat.com
Subject: Re: [PATCH v3] gdb: Add python support for demangling register unwind values
Date: Thu, 30 Apr 2026 19:05:46 +0300 [thread overview]
Message-ID: <86ik98302t.fsf@gnu.org> (raw)
In-Reply-To: <20260430153155.979053-1-craig.blackmore@embecosm.com> (message from Craig Blackmore on Thu, 30 Apr 2026 16:31:55 +0100)
> From: Craig Blackmore <craig.blackmore@embecosm.com>
> Cc: aburgess@redhat.com,
> eliz@gnu.org,
> Craig Blackmore <craig.blackmore@embecosm.com>
> Date: Thu, 30 Apr 2026 16:31:55 +0100
>
> gdb/NEWS | 20 +++
> gdb/doc/python.texi | 95 ++++++++++
> gdb/extension-priv.h | 8 +
> gdb/extension.c | 35 ++++
> gdb/extension.h | 6 +
> gdb/frame.c | 9 +
> gdb/guile/guile.c | 2 +
> gdb/python/lib/gdb/__init__.py | 21 +++
> gdb/python/lib/gdb/unwinder.py | 89 ++++++++-
> gdb/python/py-registers.c | 2 +-
> gdb/python/py-unwind.c | 169 ++++++++++++++++++
> gdb/python/py-value.c | 21 +++
> gdb/python/python-internal.h | 3 +
> gdb/python/python.c | 4 +-
> .../gdb.python/py-unwind-transformer-error.py | 33 ++++
> .../gdb.python/py-unwind-transformer.c | 80 +++++++++
> .../gdb.python/py-unwind-transformer.exp | 115 ++++++++++++
> .../gdb.python/py-unwind-transformer.py | 48 +++++
> gdb/testsuite/gdb.python/py-value.exp | 8 +
> 19 files changed, 765 insertions(+), 3 deletions(-)
> create mode 100644 gdb/testsuite/gdb.python/py-unwind-transformer-error.py
> create mode 100644 gdb/testsuite/gdb.python/py-unwind-transformer.c
> create mode 100644 gdb/testsuite/gdb.python/py-unwind-transformer.exp
> create mode 100644 gdb/testsuite/gdb.python/py-unwind-transformer.py
Thanks.
> diff --git a/gdb/NEWS b/gdb/NEWS
> index e233906153a..c1dc008280e 100644
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -457,6 +457,26 @@ info threads [-gid] [-stopped] [-running] [ID]...
> unavailability like gdb.Value.is_optimized_out checks for
> optimized out values.
>
> + ** New constants gdb.NOT_LVAL, gdb.LVAL_REGISTER and gdb.LVAL_MEMORY
> + to represent the lval_type of a value.
> +
> + ** New read-only attribute gdb.Value.lval_type which indicates the
> + lval_type of the value. Currently supports not_lval, lval_register
> + and lval_memory. Any other type is mapped to not_lval. Additional
> + types may be supported in future.
> +
> + ** Added gdb.unwinder.UnwindRegisterValueTransformer. This is the
> + base class for transformers which provide methods for transforming
> + unwind register values. Currently one such method, demangle, is
> + supported, which is called after obtaining a register value from an
> + unwinder and allows that value to be demangled before being used by
> + GDB.
> +
> + ** New function gdb.unwinder.register_unwind_register_value_transformer
> + that can register an instance of a sub-class of
> + gdb.unwinder.UnwindRegisterValueTransformer as a transformer for
> + unwind register values.
> +
> * Guile API
This part is okay.
> +@defvar Value.lval_type
> +The lval_type of this @code{gdb.Value}. The value of this attribute can
What is "lval_type"? If it's a known term in Python programming,
please give it the @code markup. Alternatively, replace with just
"type", a common word.
> +Additional lval_types may be added in future.
Same here.
> +Currently, only one transformer can be registered at any one time and it
> +is registered globally. Attempting to register more than one
> +transformer or to a different locus will raise an exception.
> +Registering more than one transformer or to different loci may be
> +supported in future.
I'd remove the last sentence, it isn't useful in the manual.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
next prev parent reply other threads:[~2026-04-30 16:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 11:04 [RFC PATCH] " Craig Blackmore
2025-04-10 12:31 ` Eli Zaretskii
2025-05-08 10:17 ` [RFC PATCH v2] " Craig Blackmore
2025-05-08 11:40 ` Eli Zaretskii
2025-05-12 13:15 ` Andrew Burgess
2026-04-30 15:19 ` Craig Blackmore
2026-04-30 15:31 ` [PATCH v3] " Craig Blackmore
2026-04-30 16:05 ` Eli Zaretskii [this message]
2026-05-20 13:16 ` [PATCH v4 0/1] " Craig Blackmore
2026-05-20 13:16 ` [PATCH v4 1/1] " Craig Blackmore
2026-05-20 15:44 ` Eli Zaretskii
2026-05-21 9:47 ` Andrew Burgess
2026-05-27 10:49 ` Craig Blackmore
2026-06-08 12:04 ` [PATCH v5 0/1] " Craig Blackmore
2026-06-08 12:04 ` [PATCH v5 1/1] gdb: Add python support for transforming " Craig Blackmore
2026-06-08 12:13 ` Eli Zaretskii
2026-07-15 9:56 ` [PING][PATCH v5 0/1] gdb: Add python support for demangling " Craig Blackmore
2026-07-29 15:01 ` [PATCH " Craig Blackmore
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=86ik98302t.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=aburgess@redhat.com \
--cc=craig.blackmore@embecosm.com \
--cc=gdb-patches@sourceware.org \
/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