[Bug python/12806] multi-level pretty-printing

stgatilov at gmail dot com via Gdb-prs <[email protected]> Mon, 03 Aug 2026 19:07:48 +0000
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=3D12806

Stepan Gatilov <stgatilov at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stgatilov at gmail dot com

--- Comment #9 from Stepan Gatilov <stgatilov at gmail dot com> ---
Meanwhile, it technically possible to implement this feature on top on the
existing GDB pretty printers API, albeit not very cleanly.

The idea is to put everything you need to properly display the value into s=
ome
global table, then wrap the index in this table into a gdb.Value of artific=
ial
type. Then write pretty printer for this artificial type that would extract=
 the
information back from the global table and return the instance of pretty
printer you want.

It is described here:
*
https://dirtyhandscoding.github.io/posts/natvis-like-experience-with-gdb-pr=
etty-printers-implementing-natvis-features.html#printer-pinning

As soon as this feature is implemented, it is possible to do a lot of useful
stuff, e.g. JSON-like children structures, special synthetic child with raw
members, etc. It is mostly limited by imagination and eagerness to write and
debug a lot of Python code =3D)

--=20
You are receiving this mail because:
You are on the CC list for the bug.=