public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Matt Rice <ratmice@gmail.com>
Cc: Tom Tromey <tromey@adacore.com>,
	 Simon Farre via Gdb-patches <gdb-patches@sourceware.org>,
	 Simon Farre <simon.farre.cx@gmail.com>
Subject: Re: [PATCH v1] gdb/DAP Introduce new methods to to Pretty Printers
Date: Tue, 18 Jul 2023 12:52:14 -0600	[thread overview]
Message-ID: <877cqxm4rl.fsf@tromey.com> (raw)
In-Reply-To: <CACTLOFqXSPbnT6pBQ13yg2ANAmO+qe8hAS2R9gyPr1ohG3N7Zw@mail.gmail.com> (Matt Rice's message of "Mon, 17 Jul 2023 21:53:21 +0000")

>>>>> "Matt" == Matt Rice <ratmice@gmail.com> writes:

Matt> On Thu, Jul 13, 2023 at 8:38 PM Tom Tromey via Gdb-patches
Matt> <gdb-patches@sourceware.org> wrote:
>> 
>> Maybe one way out would be to define a new way to do pretty-printers,
>> with a compatibility shim.

Matt> FWIW, there has been a bit of spit-balling within the rust community
Matt> about leveraging Debug trait implementations
Matt> within pretty printers, where what seemed to me like the obvious way
Matt> to leverage these was to compile Debug impls to wasm,
Matt> and write a python wrapper which calls into the wasm.  I haven't
Matt> thought or looked into it too much to have considered any hurdles of
Matt> this approach really, but it would be nice if languages with wasm
Matt> toolchains could define/compile pretty printers in their own language,
Matt> since often they already exist for the purpose of runtime logging...
Matt> Seemed worth bringing up if we're spit-balling here too.

Ages ago I looked into this a little, the idea being to compile selected
functions to Python using the gdb API.  In the end though it seemed too
hard for the value it would deliver.

Anyway, the wasm approach seems fine -- they solved all the toolchain
problems, which is nice.  The main issue is that, IIUC, debug traits
just emit a string representation -- but IMO the debugger really wants a
more key-value / array-like representation.

This seems like something that could be implemented "on the side", like
the way that gdb-natvis exists.

Tom

  reply	other threads:[~2023-07-18 18:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-25  9:21 Simon Farre
2023-06-25 10:22 ` Eli Zaretskii
2023-07-13 20:38 ` Tom Tromey
2023-07-17 20:52   ` Simon Farre
2023-07-19 14:41     ` Tom Tromey
2023-07-17 21:53   ` Matt Rice
2023-07-18 18:52     ` Tom Tromey [this message]
2023-07-20  9:47       ` Simon Farre
2023-07-21  0:27         ` Matt Rice

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=877cqxm4rl.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ratmice@gmail.com \
    --cc=simon.farre.cx@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).