Commit 916f27ad by Tom de Vries Committed by Tom de Vries

[debug] Respect fdump-noaddr and fdump-unnumbered in print_die

2018-08-21  Tom de Vries  <tdevries@suse.de>

	* dwarf2out.c (print_dw_val, print_loc_descr, print_die): Handle
	flag_dump_noaddr and flag_dump_unnumbered.

From-SVN: r263686
parent 70eff705
2018-08-21 Tom de Vries <tdevries@suse.de>
* dwarf2out.c (print_dw_val, print_loc_descr, print_die): Handle
flag_dump_noaddr and flag_dump_unnumbered.
2018-08-21 Aldy Hernandez <aldyh@redhat.com> 2018-08-21 Aldy Hernandez <aldyh@redhat.com>
* wide-int-range.cc (wide_int_range_abs): New. * wide-int-range.cc (wide_int_range_abs): New.
......
...@@ -6455,7 +6455,12 @@ print_dw_val (dw_val_node *val, bool recurse, FILE *outfile) ...@@ -6455,7 +6455,12 @@ print_dw_val (dw_val_node *val, bool recurse, FILE *outfile)
print_indent -= 4; print_indent -= 4;
} }
else else
{
if (flag_dump_noaddr || flag_dump_unnumbered)
fprintf (outfile, " #\n");
else
fprintf (outfile, " (%p)\n", (void *) val->v.val_loc); fprintf (outfile, " (%p)\n", (void *) val->v.val_loc);
}
break; break;
case dw_val_class_loc_list: case dw_val_class_loc_list:
fprintf (outfile, "location list -> label:%s", fprintf (outfile, "location list -> label:%s",
...@@ -6524,6 +6529,9 @@ print_dw_val (dw_val_node *val, bool recurse, FILE *outfile) ...@@ -6524,6 +6529,9 @@ print_dw_val (dw_val_node *val, bool recurse, FILE *outfile)
} }
else else
fprintf (outfile, "die -> %ld", die->die_offset); fprintf (outfile, "die -> %ld", die->die_offset);
if (flag_dump_noaddr || flag_dump_unnumbered)
fprintf (outfile, " #");
else
fprintf (outfile, " (%p)", (void *) die); fprintf (outfile, " (%p)", (void *) die);
} }
else else
...@@ -6614,8 +6622,11 @@ print_loc_descr (dw_loc_descr_ref loc, FILE *outfile) ...@@ -6614,8 +6622,11 @@ print_loc_descr (dw_loc_descr_ref loc, FILE *outfile)
for (l = loc; l != NULL; l = l->dw_loc_next) for (l = loc; l != NULL; l = l->dw_loc_next)
{ {
print_spaces (outfile); print_spaces (outfile);
fprintf (outfile, "(%p) %s", if (flag_dump_noaddr || flag_dump_unnumbered)
(void *) l, fprintf (outfile, "#");
else
fprintf (outfile, "(%p)", (void *) l);
fprintf (outfile, " %s",
dwarf_stack_op_name (l->dw_loc_opc)); dwarf_stack_op_name (l->dw_loc_opc));
if (l->dw_loc_oprnd1.val_class != dw_val_class_none) if (l->dw_loc_oprnd1.val_class != dw_val_class_none)
{ {
...@@ -6642,9 +6653,12 @@ print_die (dw_die_ref die, FILE *outfile) ...@@ -6642,9 +6653,12 @@ print_die (dw_die_ref die, FILE *outfile)
unsigned ix; unsigned ix;
print_spaces (outfile); print_spaces (outfile);
fprintf (outfile, "DIE %4ld: %s (%p)\n", fprintf (outfile, "DIE %4ld: %s ",
die->die_offset, dwarf_tag_name (die->die_tag), die->die_offset, dwarf_tag_name (die->die_tag));
(void*) die); if (flag_dump_noaddr || flag_dump_unnumbered)
fprintf (outfile, "#\n");
else
fprintf (outfile, "(%p)\n", (void*) die);
print_spaces (outfile); print_spaces (outfile);
fprintf (outfile, " abbrev id: %lu", die->die_abbrev); fprintf (outfile, " abbrev id: %lu", die->die_abbrev);
fprintf (outfile, " offset: %ld", die->die_offset); fprintf (outfile, " offset: %ld", die->die_offset);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment