diff options
author | Tom Tromey <tom@tromey.com> | 2021-12-11 14:57:17 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-12-20 09:49:41 -0700 |
commit | 6bebf813ac2d4b92facae7b18161aad1b734a894 (patch) | |
tree | aaa28c29f4665e5db0bf87e0167f88122e55b433 /gdb/dwarf2 | |
parent | b0715493df19e5223251c5be0efc7f180aa0a5ff (diff) | |
download | gdb-6bebf813ac2d4b92facae7b18161aad1b734a894.zip gdb-6bebf813ac2d4b92facae7b18161aad1b734a894.tar.gz gdb-6bebf813ac2d4b92facae7b18161aad1b734a894.tar.bz2 |
Remove print_spaces
This removes the print_spaces helper function, in favor of using the
"*%s" idiom that's already used in many places in gdb. One spot (in
symmisc.c) is changed to use print_spaces_filtered, because the rest
of that function is using filtered output. (This highlights one way
that the printf idiom is better -- this error is harder to make when
using that.)
Regression tested on x86-64 Fedora 34.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/read.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index dd2134b..36b7432 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -22980,31 +22980,28 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) { unsigned int i; - print_spaces (indent, f); - fprintf_unfiltered (f, "Die: %s (abbrev %d, offset %s)\n", + fprintf_unfiltered (f, "%*sDie: %s (abbrev %d, offset %s)\n", + indent, "", dwarf_tag_name (die->tag), die->abbrev, sect_offset_str (die->sect_off)); if (die->parent != NULL) - { - print_spaces (indent, f); - fprintf_unfiltered (f, " parent at offset: %s\n", - sect_offset_str (die->parent->sect_off)); - } + fprintf_unfiltered (f, "%*s parent at offset: %s\n", + indent, "", + sect_offset_str (die->parent->sect_off)); - print_spaces (indent, f); - fprintf_unfiltered (f, " has children: %s\n", - dwarf_bool_name (die->child != NULL)); + fprintf_unfiltered (f, "%*s has children: %s\n", + indent, "", + dwarf_bool_name (die->child != NULL)); - print_spaces (indent, f); - fprintf_unfiltered (f, " attributes:\n"); + fprintf_unfiltered (f, "%*s attributes:\n", indent, ""); for (i = 0; i < die->num_attrs; ++i) { - print_spaces (indent, f); - fprintf_unfiltered (f, " %s (%s) ", - dwarf_attr_name (die->attrs[i].name), - dwarf_form_name (die->attrs[i].form)); + fprintf_unfiltered (f, "%*s %s (%s) ", + indent, "", + dwarf_attr_name (die->attrs[i].name), + dwarf_form_name (die->attrs[i].form)); switch (die->attrs[i].form) { @@ -23120,8 +23117,7 @@ dump_die_1 (struct ui_file *f, int level, int max_level, struct die_info *die) if (die->child != NULL) { - print_spaces (indent, f); - fprintf_unfiltered (f, " Children:"); + fprintf_unfiltered (f, "%*s Children:", indent, ""); if (level + 1 < max_level) { fprintf_unfiltered (f, "\n"); |