From 916f27adfdf0a2aa8a8d30fa68f86d5eab226ff9 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 21 Aug 2018 07:39:17 +0000 Subject: [PATCH] [debug] Respect fdump-noaddr and fdump-unnumbered in print_die 2018-08-21 Tom de Vries * dwarf2out.c (print_dw_val, print_loc_descr, print_die): Handle flag_dump_noaddr and flag_dump_unnumbered. From-SVN: r263686 --- gcc/ChangeLog | 5 +++++ gcc/dwarf2out.c | 28 +++++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ad722fde33c..eb9c1518062 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-08-21 Tom de Vries + + * dwarf2out.c (print_dw_val, print_loc_descr, print_die): Handle + flag_dump_noaddr and flag_dump_unnumbered. + 2018-08-21 Aldy Hernandez * wide-int-range.cc (wide_int_range_abs): New. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index b80c909e1fc..ffb332a358d 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -6455,7 +6455,12 @@ print_dw_val (dw_val_node *val, bool recurse, FILE *outfile) print_indent -= 4; } else - fprintf (outfile, " (%p)\n", (void *) val->v.val_loc); + { + if (flag_dump_noaddr || flag_dump_unnumbered) + fprintf (outfile, " #\n"); + else + fprintf (outfile, " (%p)\n", (void *) val->v.val_loc); + } break; case dw_val_class_loc_list: fprintf (outfile, "location list -> label:%s", @@ -6524,7 +6529,10 @@ print_dw_val (dw_val_node *val, bool recurse, FILE *outfile) } else fprintf (outfile, "die -> %ld", die->die_offset); - fprintf (outfile, " (%p)", (void *) die); + if (flag_dump_noaddr || flag_dump_unnumbered) + fprintf (outfile, " #"); + else + fprintf (outfile, " (%p)", (void *) die); } else fprintf (outfile, "die -> "); @@ -6614,8 +6622,11 @@ print_loc_descr (dw_loc_descr_ref loc, FILE *outfile) for (l = loc; l != NULL; l = l->dw_loc_next) { print_spaces (outfile); - fprintf (outfile, "(%p) %s", - (void *) l, + if (flag_dump_noaddr || flag_dump_unnumbered) + fprintf (outfile, "#"); + else + fprintf (outfile, "(%p)", (void *) l); + fprintf (outfile, " %s", dwarf_stack_op_name (l->dw_loc_opc)); if (l->dw_loc_oprnd1.val_class != dw_val_class_none) { @@ -6642,9 +6653,12 @@ print_die (dw_die_ref die, FILE *outfile) unsigned ix; print_spaces (outfile); - fprintf (outfile, "DIE %4ld: %s (%p)\n", - die->die_offset, dwarf_tag_name (die->die_tag), - (void*) die); + fprintf (outfile, "DIE %4ld: %s ", + die->die_offset, dwarf_tag_name (die->die_tag)); + if (flag_dump_noaddr || flag_dump_unnumbered) + fprintf (outfile, "#\n"); + else + fprintf (outfile, "(%p)\n", (void*) die); print_spaces (outfile); fprintf (outfile, " abbrev id: %lu", die->die_abbrev); fprintf (outfile, " offset: %ld", die->die_offset); -- 2.30.2