From: Richard Biener <richard.guenther@gmail.com>
To: Tom Tromey <tromey@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Prettify output of debug_dwarf_die
Date: Tue, 2 Apr 2024 08:56:48 +0200 [thread overview]
Message-ID: <CAFiYyc1DL_h+M0B+ntd0jps3SxKDf2mRM9=v_8jxwb_K-LB4HA@mail.gmail.com> (raw)
In-Reply-To: <20240328193413.1566475-1-tromey@adacore.com>
On Thu, Mar 28, 2024 at 8:35 PM Tom Tromey <tromey@adacore.com> wrote:
>
> When debugging gcc, I tried calling debug_dwarf_die and I saw this
> output:
>
> DW_AT_location: location descriptor:
> (0x7fffe9c2e870) DW_OP_dup 0, 0
> (0x7fffe9c2e8c0) DW_OP_bra location descriptor (0x7fffe9c2e640)
> , 0
> (0x7fffe9c2e820) DW_OP_lit4 4, 0
> (0x7fffe9c2e910) DW_OP_skip location descriptor (0x7fffe9c2e9b0)
> , 0
> (0x7fffe9c2e640) DW_OP_dup 0, 0
>
> I think those ", 0" should not appear on their own lines. The issue
> seems to be that print_dw_val should not generally emit a newline,
> except when recursing.
OK.
> gcc/ChangeLog
>
> * dwarf2out.cc (print_dw_val) <dw_val_class_loc>: Don't
> print newline when not recursing.
> ---
> gcc/dwarf2out.cc | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
> index 8f18bc4fe64..1b0e8b5a5b2 100644
> --- a/gcc/dwarf2out.cc
> +++ b/gcc/dwarf2out.cc
> @@ -6651,7 +6651,7 @@ print_dw_val (dw_val_node *val, bool recurse, FILE *outfile)
> case dw_val_class_loc:
> fprintf (outfile, "location descriptor");
> if (val->v.val_loc == NULL)
> - fprintf (outfile, " -> <null>\n");
> + fprintf (outfile, " -> <null>");
> else if (recurse)
> {
> fprintf (outfile, ":\n");
> @@ -6662,9 +6662,9 @@ print_dw_val (dw_val_node *val, bool recurse, FILE *outfile)
> else
> {
> if (flag_dump_noaddr || flag_dump_unnumbered)
> - fprintf (outfile, " #\n");
> + fprintf (outfile, " #");
> else
> - fprintf (outfile, " (%p)\n", (void *) val->v.val_loc);
> + fprintf (outfile, " (%p)", (void *) val->v.val_loc);
> }
> break;
> case dw_val_class_loc_list:
> --
> 2.43.0
>
prev parent reply other threads:[~2024-04-02 6:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 19:34 Tom Tromey
2024-04-02 6:56 ` Richard Biener [this message]
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='CAFiYyc1DL_h+M0B+ntd0jps3SxKDf2mRM9=v_8jxwb_K-LB4HA@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=tromey@adacore.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).