From: Richard Biener <richard.guenther@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Robert Dubner <rdubner@symas.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] developer option: -fdump-generic-nodes; initial incorporation
Date: Wed, 28 Feb 2024 09:33:36 +0100 [thread overview]
Message-ID: <CAFiYyc0n0DnYZfUDoJxCf=sotq7D=G+Rbe16NS3wuwTkp3K_aA@mail.gmail.com> (raw)
In-Reply-To: <Zd7t97YBn/p29eBk@tucnak>
On Wed, Feb 28, 2024 at 9:25 AM Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Wed, Feb 28, 2024 at 08:58:08AM +0100, Richard Biener wrote:
> > Incidentially this looks like something fit for a google summer of code project.
> > Ideally it would hook into print-tree.cc providing an alternate
> > structured output.
> > It currently prints in the style
> >
> > <function_decl 0x7ffff71bc600 bswap16
> > type <function_type 0x7ffff71ba5e8
> > type <integer_type 0x7ffff702b540 short unsigned int public unsigned HI
> > size <integer_cst 0x7ffff702d108 constant 16>
> > unit-size <integer_cst 0x7ffff702d120 constant 2>
> > align:16 warn_if_not_align:0 symtab:0 alias-set -1
> > canonical-type 0x7ffff702b540 precision:16 min <integer_cst
> > 0x7ffff702d138 0> max <integer_cst 0x7ffff702d0f0 65535>>
> > QI
> > size <integer_cst 0x7ffff702d048 constant 8>
> > unit-size <integer_cst 0x7ffff702d060 constant 1>
> > ...
> >
> > where you can see it follows tree -> tree edges up to some depth
> > (and avoids repeated expansion). When debugging that's all I have
> > and I have to follow edges by matching up the raw addresses printed,
> > re-dumping those that didn't get expanded. HTML would be indeed
> > so much nicer here (and a more complete output).
>
> I think keeping the current format of what is printed but optionally just
> turn all those addresses in there into hyperlinks which would expand the
> other trees would be nice. Maybe also allow just hovering on the link and
> show the other tree printed might be nice too.
> Folding it all into just <function_decl ... bswap <type link> ...>
> would mean one can't quickly access just the min/max or fn return type
> etc. We might need some parameter how deep to go (and/or how many trees to
> dump at most) so that we don't dump into HTML gigabytes of data when asking
> to print say a large BIND_EXPR into HTML.
Btw, when in a debugging session I'd be fine with something like
(gdb) html-tree $3
creating a temporary file and spawning a window using the default .html
file handler with this being implemented in the python bindings similar
to how we handle dot-fn. I realize that some terminals might support
parts of that "inline" (I bet my xterm doesn't ;)).
I think HTML might be machine-readable enough for this purpose
so indirecting via JSON or XML or whatnot isn't necessary (we don't
aim for this to be a way to extract GENERIC and feed it to another compiler).
Richard.
>
> Jakub
>
next prev parent reply other threads:[~2024-02-28 8:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 16:45 Robert Dubner
2024-02-27 9:11 ` Richard Biener
2024-02-27 21:20 ` Robert Dubner
2024-02-28 7:58 ` Richard Biener
2024-02-28 8:25 ` Jakub Jelinek
2024-02-28 8:33 ` Richard Biener [this message]
2024-02-28 15:14 ` David Malcolm
2024-02-29 7:33 ` Richard Biener
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='CAFiYyc0n0DnYZfUDoJxCf=sotq7D=G+Rbe16NS3wuwTkp3K_aA@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=rdubner@symas.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).