Rename print_spaces_filtered

print_spaces_filtered is now misnamed, because whether filtering
happens is up to the stream.  So, rename it.
This commit is contained in:
Tom Tromey 2022-01-02 11:53:15 -07:00
parent 6cb06a8cda
commit d0b1020bf1
17 changed files with 47 additions and 47 deletions

View file

@ -166,7 +166,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
if (options->prettyformat_arrays) if (options->prettyformat_arrays)
{ {
gdb_printf (stream, ",\n"); gdb_printf (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
else else
{ {
@ -176,7 +176,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
else if (options->prettyformat_arrays) else if (options->prettyformat_arrays)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
stream->wrap_here (2 + 2 * recurse); stream->wrap_here (2 + 2 * recurse);
maybe_print_array_index (index_type, i + low, stream, options); maybe_print_array_index (index_type, i + low, stream, options);
@ -229,7 +229,7 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
if (options->prettyformat_arrays) if (options->prettyformat_arrays)
{ {
gdb_printf (stream, ",\n"); gdb_printf (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
else else
{ {
@ -621,7 +621,7 @@ print_field_values (struct value *value, struct value *outer_value,
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
else else
{ {
@ -887,7 +887,7 @@ ada_val_print_struct_union (struct value *value,
&& options->prettyformat) && options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 * recurse, stream); print_spaces (2 * recurse, stream);
} }
gdb_printf (stream, ")"); gdb_printf (stream, ")");

View file

@ -906,7 +906,7 @@ c_type_print_template_args (const struct type_print_options *flags,
gdb_puts (_("] "), stream); gdb_puts (_("] "), stream);
} }
/* Use 'print_spaces_filtered', but take into consideration the /* Use 'print_spaces', but take into consideration the
type_print_options FLAGS in order to determine how many whitespaces type_print_options FLAGS in order to determine how many whitespaces
will be printed. */ will be printed. */
@ -915,9 +915,9 @@ print_spaces_filtered_with_print_options
(int level, struct ui_file *stream, const struct type_print_options *flags) (int level, struct ui_file *stream, const struct type_print_options *flags)
{ {
if (!flags->print_offsets) if (!flags->print_offsets)
print_spaces_filtered (level, stream); print_spaces (level, stream);
else else
print_spaces_filtered (level + print_offset_data::indentation, stream); print_spaces (level + print_offset_data::indentation, stream);
} }
/* Output an access specifier to STREAM, if needed. LAST_ACCESS is the /* Output an access specifier to STREAM, if needed. LAST_ACCESS is the
@ -1175,7 +1175,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
if (flags->print_offsets) if (flags->print_offsets)
podata->update (type, i, stream); podata->update (type, i, stream);
print_spaces_filtered (level + 4, stream); print_spaces (level + 4, stream);
if (is_static) if (is_static)
gdb_printf (stream, "static "); gdb_printf (stream, "static ");
@ -1426,9 +1426,9 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
if (show > 0) if (show > 0)
podata->finish (type, level, stream); podata->finish (type, level, stream);
print_spaces_filtered (print_offset_data::indentation, stream); print_spaces (print_offset_data::indentation, stream);
if (level == 0) if (level == 0)
print_spaces_filtered (2, stream); print_spaces (2, stream);
} }
gdb_printf (stream, "%*s}", level, ""); gdb_printf (stream, "%*s}", level, "");
@ -1639,7 +1639,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
QUIT; QUIT;
print_spaces_filtered (level + 4, stream); print_spaces (level + 4, stream);
/* We pass "show" here and not "show - 1" to get enum types /* We pass "show" here and not "show - 1" to get enum types
printed. There's no other way to see them. */ printed. There's no other way to see them. */
c_print_type_1 (type->field (i).type (), c_print_type_1 (type->field (i).type (),

View file

@ -222,7 +222,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype,
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
} }
} }

View file

@ -211,7 +211,7 @@ cli_ui_out::do_spaces (int numspaces)
if (test_flags (unfiltered_output)) if (test_flags (unfiltered_output))
gdb_printf (m_streams.back (), "%*s", numspaces, ""); gdb_printf (m_streams.back (), "%*s", numspaces, "");
else else
print_spaces_filtered (numspaces, m_streams.back ()); print_spaces (numspaces, m_streams.back ());
} }
void void

View file

@ -207,7 +207,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
gdb_puts ("members of ", stream); gdb_puts ("members of ", stream);
gdb_puts (type->name (), stream); gdb_puts (type->name (), stream);
gdb_puts (":", stream); gdb_puts (":", stream);
@ -218,7 +218,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
else else
{ {
@ -374,7 +374,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 * recurse, stream); print_spaces (2 * recurse, stream);
} }
} /* if there are data fields */ } /* if there are data fields */
@ -479,7 +479,7 @@ cp_print_value (struct value *val, struct ui_file *stream,
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 * recurse, stream); print_spaces (2 * recurse, stream);
} }
gdb_puts ("<", stream); gdb_puts ("<", stream);
/* Not sure what the best notation is in the case where there is /* Not sure what the best notation is in the case where there is

View file

@ -858,7 +858,7 @@ ppscm_print_children (SCM printer, enum display_hint hint,
if (pretty) if (pretty)
{ {
gdb_puts ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
else else
stream->wrap_here (2 + 2 *recurse); stream->wrap_here (2 + 2 *recurse);
@ -930,14 +930,14 @@ ppscm_print_children (SCM printer, enum display_hint hint,
if (pretty) if (pretty)
{ {
gdb_puts ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
gdb_puts ("...", stream); gdb_puts ("...", stream);
} }
if (pretty) if (pretty)
{ {
gdb_puts ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 * recurse, stream); print_spaces (2 * recurse, stream);
} }
gdb_puts ("}", stream); gdb_puts ("}", stream);
} }

View file

@ -562,7 +562,7 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show,
{ {
QUIT; QUIT;
print_spaces_filtered (level + 4, stream); print_spaces (level + 4, stream);
fputs_styled (type->field (i).name (), fputs_styled (type->field (i).name (),
variable_name_style.style (), stream); variable_name_style.style (), stream);
gdb_puts (" : ", stream); gdb_puts (" : ", stream);

View file

@ -561,7 +561,7 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int
} }
} }
print_spaces_filtered (level + 4, stream); print_spaces (level + 4, stream);
if (field_is_static (&type->field (i))) if (field_is_static (&type->field (i)))
gdb_printf (stream, "static "); gdb_printf (stream, "static ");
print_type (type->field (i).type (), print_type (type->field (i).type (),
@ -633,7 +633,7 @@ pascal_language::type_print_base (struct type *type, struct ui_file *stream, int
} }
} }
print_spaces_filtered (level + 4, stream); print_spaces (level + 4, stream);
if (TYPE_FN_FIELD_STATIC_P (f, j)) if (TYPE_FN_FIELD_STATIC_P (f, j))
gdb_printf (stream, "static "); gdb_printf (stream, "static ");
if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) == 0) if (TYPE_TARGET_TYPE (TYPE_FN_FIELD_TYPE (f, j)) == 0)

View file

@ -267,7 +267,7 @@ pascal_language::value_print_inner (struct value *val,
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
} }
} }
@ -559,7 +559,7 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream,
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
gdb_puts ("members of ", stream); gdb_puts ("members of ", stream);
gdb_puts (type->name (), stream); gdb_puts (type->name (), stream);
gdb_puts (": ", stream); gdb_puts (": ", stream);
@ -570,7 +570,7 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream,
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
else else
{ {
@ -671,7 +671,7 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream,
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 * recurse, stream); print_spaces (2 * recurse, stream);
} }
} }
gdb_printf (stream, "}"); gdb_printf (stream, "}");
@ -762,7 +762,7 @@ pascal_object_print_value (struct value *val, struct ui_file *stream,
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 * recurse, stream); print_spaces (2 * recurse, stream);
} }
gdb_puts ("<", stream); gdb_puts ("<", stream);
/* Not sure what the best notation is in the case where there is no /* Not sure what the best notation is in the case where there is no

View file

@ -471,7 +471,7 @@ print_children (PyObject *printer, const char *hint,
if (pretty) if (pretty)
{ {
gdb_puts ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
else else
stream->wrap_here (2 + 2 *recurse); stream->wrap_here (2 + 2 *recurse);
@ -550,14 +550,14 @@ print_children (PyObject *printer, const char *hint,
if (pretty) if (pretty)
{ {
gdb_puts ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
gdb_puts ("...", stream); gdb_puts ("...", stream);
} }
if (pretty) if (pretty)
{ {
gdb_puts ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 * recurse, stream); print_spaces (2 * recurse, stream);
} }
gdb_puts ("}", stream); gdb_puts ("}", stream);
} }

View file

@ -1038,7 +1038,7 @@ riscv_print_one_register_info (struct gdbarch *gdbarch,
enum tab_stops { value_column_1 = 15 }; enum tab_stops { value_column_1 = 15 };
gdb_puts (name, file); gdb_puts (name, file);
print_spaces_filtered (value_column_1 - strlen (name), file); print_spaces (value_column_1 - strlen (name), file);
try try
{ {

View file

@ -372,7 +372,7 @@ rust_language::val_print_struct
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_puts ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
else if (!first_field) else if (!first_field)
gdb_puts (" ", stream); gdb_puts (" ", stream);
@ -393,7 +393,7 @@ rust_language::val_print_struct
if (options->prettyformat) if (options->prettyformat)
{ {
gdb_puts ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (2 * recurse, stream); print_spaces (2 * recurse, stream);
} }
if (is_tuple || is_tuple_struct) if (is_tuple || is_tuple_struct)
@ -707,7 +707,7 @@ rust_print_struct_def (struct type *type, const char *varstring,
/* For a tuple struct we print the type but nothing /* For a tuple struct we print the type but nothing
else. */ else. */
if (!for_rust_enum || flags->print_offsets) if (!for_rust_enum || flags->print_offsets)
print_spaces_filtered (level + 2, stream); print_spaces (level + 2, stream);
if (is_enum) if (is_enum)
fputs_styled (type->field (i).name (), variable_name_style.style (), fputs_styled (type->field (i).name (), variable_name_style.style (),
stream); stream);
@ -733,12 +733,12 @@ rust_print_struct_def (struct type *type, const char *varstring,
/* Undo the temporary level increase we did above. */ /* Undo the temporary level increase we did above. */
level -= 2; level -= 2;
podata->finish (type, level, stream); podata->finish (type, level, stream);
print_spaces_filtered (print_offset_data::indentation, stream); print_spaces (print_offset_data::indentation, stream);
if (level == 0) if (level == 0)
print_spaces_filtered (2, stream); print_spaces (2, stream);
} }
if (!for_rust_enum || flags->print_offsets) if (!for_rust_enum || flags->print_offsets)
print_spaces_filtered (level, stream); print_spaces (level, stream);
gdb_puts (is_tuple_struct ? ")" : "}", stream); gdb_puts (is_tuple_struct ? ")" : "}", stream);
} }

View file

@ -507,7 +507,7 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol,
else else
section = NULL; section = NULL;
print_spaces_filtered (depth, outfile); print_spaces (depth, outfile);
if (symbol->domain () == LABEL_DOMAIN) if (symbol->domain () == LABEL_DOMAIN)
{ {
gdb_printf (outfile, "label %s at ", symbol->print_name ()); gdb_printf (outfile, "label %s at ", symbol->print_name ());

View file

@ -127,7 +127,7 @@ print_offset_data::update (struct type *type, unsigned int field_idx,
{ {
if (field_is_static (&type->field (field_idx))) if (field_is_static (&type->field (field_idx)))
{ {
print_spaces_filtered (indentation, stream); print_spaces (indentation, stream);
return; return;
} }
@ -188,7 +188,7 @@ print_offset_data::finish (struct type *type, int level,
maybe_print_hole (stream, bitpos, "padding"); maybe_print_hole (stream, bitpos, "padding");
gdb_puts ("\n", stream); gdb_puts ("\n", stream);
print_spaces_filtered (level + 4 + print_offset_data::indentation, stream); print_spaces (level + 4 + print_offset_data::indentation, stream);
gdb_printf (stream, "/* total size (bytes): %4s */\n", gdb_printf (stream, "/* total size (bytes): %4s */\n",
pulongest (TYPE_LENGTH (type))); pulongest (TYPE_LENGTH (type)));
} }

View file

@ -1907,7 +1907,7 @@ n_spaces (int n)
/* Print N spaces. */ /* Print N spaces. */
void void
print_spaces_filtered (int n, struct ui_file *stream) print_spaces (int n, struct ui_file *stream)
{ {
gdb_puts (n_spaces (n), stream); gdb_puts (n_spaces (n), stream);
} }

View file

@ -255,7 +255,7 @@ extern void gdb_printf (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
extern void printf_unfiltered (const char *, ...) ATTRIBUTE_PRINTF (1, 2); extern void printf_unfiltered (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
extern void print_spaces_filtered (int, struct ui_file *); extern void print_spaces (int, struct ui_file *);
extern const char *n_spaces (int); extern const char *n_spaces (int);

View file

@ -1929,7 +1929,7 @@ value_print_array_elements (struct value *val, struct ui_file *stream,
if (options->prettyformat_arrays) if (options->prettyformat_arrays)
{ {
gdb_printf (stream, ",\n"); gdb_printf (stream, ",\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
else else
gdb_printf (stream, ", "); gdb_printf (stream, ", ");
@ -1937,7 +1937,7 @@ value_print_array_elements (struct value *val, struct ui_file *stream,
else if (options->prettyformat_arrays) else if (options->prettyformat_arrays)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream); print_spaces (2 + 2 * recurse, stream);
} }
stream->wrap_here (2 + 2 * recurse); stream->wrap_here (2 + 2 * recurse);
maybe_print_array_index (index_type, i + low_bound, maybe_print_array_index (index_type, i + low_bound,
@ -1985,7 +1985,7 @@ value_print_array_elements (struct value *val, struct ui_file *stream,
if (options->prettyformat_arrays) if (options->prettyformat_arrays)
{ {
gdb_printf (stream, "\n"); gdb_printf (stream, "\n");
print_spaces_filtered (2 * recurse, stream); print_spaces (2 * recurse, stream);
} }
} }