diff options
author | Tom Tromey <tromey@adacore.com> | 2020-12-17 13:29:38 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-12-17 13:29:38 -0700 |
commit | 32f47895b5859c1f34abec75478ef55f2d92b023 (patch) | |
tree | cf6b98937829b3a3d5801feea8797c3d591aedef /gdb/p-typeprint.c | |
parent | 85be4f5a8c8bec8d3163585a82e288a4dec08b07 (diff) | |
download | gdb-32f47895b5859c1f34abec75478ef55f2d92b023.zip gdb-32f47895b5859c1f34abec75478ef55f2d92b023.tar.gz gdb-32f47895b5859c1f34abec75478ef55f2d92b023.tar.bz2 |
Remove printfi_filtered and fprintfi_filtered
After seeing Simon's patch, I thought maybe it was finally time to
remove printfi_filtered and fprintfi_filtered, in favor of using the
"%*s" approach to indenting.
In this patch I took the straightforward approach of always adding a
leading "%*s", even when the format already started with "%s", to
avoid the trickier form of:
printf ("%*s", -indent, string)
Regression tested on x86-64 Fedora 32.
Let me know what you think.
gdb/ChangeLog
2020-12-17 Tom Tromey <tromey@adacore.com>
* gdbtypes.c (print_args, dump_fn_fieldlists, print_cplus_stuff)
(print_gnat_stuff, print_fixed_point_type_info)
(recursive_dump_type): Update.
* go32-nat.c (go32_sysinfo, display_descriptor): Update.
* c-typeprint.c (c_type_print_base_struct_union)
(c_type_print_base_1): Update.
* rust-lang.c (rust_internal_print_type): Update.
* f-typeprint.c (f_language::f_type_print_base): Update.
* utils.h (fprintfi_filtered, printfi_filtered): Remove.
* m2-typeprint.c (m2_record_fields): Update.
* p-typeprint.c (pascal_type_print_base): Update.
* compile/compile-loc2c.c (push, pushf, unary, binary)
(do_compile_dwarf_expr_to_c): Update.
* utils.c (fprintfi_filtered, printfi_filtered): Remove.
Diffstat (limited to 'gdb/p-typeprint.c')
-rw-r--r-- | gdb/p-typeprint.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index c2c182a..b53a0de 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -564,9 +564,11 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, if ((type->num_fields () == 0) && (TYPE_NFN_FIELDS (type) == 0)) { if (type->is_stub ()) - fprintfi_filtered (level + 4, stream, "<incomplete type>\n"); + fprintf_filtered (stream, "%*s<incomplete type>\n", + level + 4, ""); else - fprintfi_filtered (level + 4, stream, "<no data fields>\n"); + fprintf_filtered (stream, "%*s<no data fields>\n", + level + 4, ""); } /* Start off with no specific section type, so we can print @@ -597,8 +599,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, if (section_type != s_protected) { section_type = s_protected; - fprintfi_filtered (level + 2, stream, - "protected\n"); + fprintf_filtered (stream, "%*sprotected\n", + level + 2, ""); } } else if (TYPE_FIELD_PRIVATE (type, i)) @@ -606,7 +608,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, if (section_type != s_private) { section_type = s_private; - fprintfi_filtered (level + 2, stream, "private\n"); + fprintf_filtered (stream, "%*sprivate\n", + level + 2, ""); } } else @@ -614,7 +617,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, if (section_type != s_public) { section_type = s_public; - fprintfi_filtered (level + 2, stream, "public\n"); + fprintf_filtered (stream, "%*spublic\n", + level + 2, ""); } } } @@ -668,8 +672,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, if (section_type != s_protected) { section_type = s_protected; - fprintfi_filtered (level + 2, stream, - "protected\n"); + fprintf_filtered (stream, "%*sprotected\n", + level + 2, ""); } } else if (TYPE_FN_FIELD_PRIVATE (f, j)) @@ -677,7 +681,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, if (section_type != s_private) { section_type = s_private; - fprintfi_filtered (level + 2, stream, "private\n"); + fprintf_filtered (stream, "%*sprivate\n", + level + 2, ""); } } else @@ -685,7 +690,8 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, if (section_type != s_public) { section_type = s_public; - fprintfi_filtered (level + 2, stream, "public\n"); + fprintf_filtered (stream, "%*spublic\n", + level + 2, ""); } } @@ -736,7 +742,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, fprintf_filtered (stream, ";\n"); } } - fprintfi_filtered (level, stream, "end"); + fprintf_filtered (stream, "%*send", level, ""); } break; |