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.
This commit is contained in:
Tom Tromey
2021-12-11 14:57:17 -07:00
parent b0715493df
commit 6bebf813ac
6 changed files with 19 additions and 31 deletions

View File

@@ -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");