Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Craig Blackmore <craig.blackmore@embecosm.com>
To: gdb-patches@sourceware.org
Cc: aburgess@redhat.com, eliz@gnu.org,
	Craig Blackmore <craig.blackmore@embecosm.com>
Subject: [PATCH v4 0/1] gdb: Add python support for demangling register unwind values
Date: Wed, 20 May 2026 14:16:06 +0100	[thread overview]
Message-ID: <20260520131607.32885-1-craig.blackmore@embecosm.com> (raw)
In-Reply-To: <20260430153155.979053-1-craig.blackmore@embecosm.com>

This version addresses Eli Zaretskii's review comments from:

  https://sourceware.org/pipermail/gdb-patches/2026-April/227044.html

Changes since v3:

* Change lval_type to lvalue type in NEWS and python documentation.

* Remove line about future support for multiple transformers or
  different loci from python documentation.

Changes since v2:

* Removed RFC from subject.

* Changed `gdb.unwinder.UnwindRegisterValueDemangler` to
  `gdb.unwinder.UnwindRegisterValueTransformer` so that other transform
  methods could be supported in future rather than being restricted to
  demangling only.  Demangling is now done by calling the `demangle`
  method instead of `__call__`.

* Made transformer registration similar to unwinder registration to
  allow future support for registering multiple transformers and
  registering to other loci.

* Call `invalidate_cached_frames` after registering a transformer.

* Made `gdb.unwinder.UnwindRegisterValueTransformer.name` read-only
  and added type check.

* Pass `gdb.Frame` to demanglers instead of `frame_type`.

* Added global `python_transformer_enabled` to `py-unwind.c` which
  python sets when any transformer is registered.  This allows us to
  skip entering the python environment when demangling and no
  transformers are registered.

* Replaced `gdb.Value.is_lval_register` and `gdb.Value.is_lval_memory`
  read-only boolean attributes with `gdb.Value.lval_type` read-only
  type attribute.

* Removed redundant `return` after call to `error`.

* Replaced `NULL` with `nullptr`.

* Added tests for invalid registration and invalid return value from
  demangler.

* Updated tests and documentation to match the above changes.

* Rebased.

Craig Blackmore (1):
  gdb: Add python support for demangling register unwind values

 gdb/NEWS                                      |  20 +++
 gdb/doc/python.texi                           |  93 ++++++++++
 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, 763 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

-- 
2.43.0


  parent reply	other threads:[~2026-05-20 13:16 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
2026-05-20 13:16       ` Craig Blackmore [this message]
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=20260520131607.32885-1-craig.blackmore@embecosm.com \
    --to=craig.blackmore@embecosm.com \
    --cc=aburgess@redhat.com \
    --cc=eliz@gnu.org \
    --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