From: Tom Tromey Date: Thu, 28 Mar 2024 19:22:34 +0000 (-0600) Subject: Prettify output of debug_dwarf_die X-Git-Tag: basepoints/gcc-15~385 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e459e6625ff86babc461f8ceada0a63aee5b7a5;p=thirdparty%2Fgcc.git Prettify output of debug_dwarf_die 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. gcc/ChangeLog * dwarf2out.cc (print_dw_val) : Don't print newline when not recursing. --- diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 8f18bc4fe64b..1b0e8b5a5b29 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, " -> \n"); + fprintf (outfile, " -> "); 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: