public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <richard.guenther@gmail.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:25:27 +0100	[thread overview]
Message-ID: <Zd7t97YBn/p29eBk@tucnak> (raw)
In-Reply-To: <CAFiYyc3GKf--JP1hZF+Yon8gEBeZzusBpS1MrS5vP_g8kL1_zQ@mail.gmail.com>

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.

	Jakub


  reply	other threads:[~2024-02-28  8:25 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 [this message]
2024-02-28  8:33         ` Richard Biener
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=Zd7t97YBn/p29eBk@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rdubner@symas.com \
    --cc=richard.guenther@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).