diff options
author | Tom Tromey <tom@tromey.com> | 2022-01-02 11:46:15 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-03-29 12:46:24 -0600 |
commit | 6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a (patch) | |
tree | 641a6a86240919fe4ba9219fbbbe15bc6331c22d /gdb/c-valprint.c | |
parent | a11ac3b3e8ff6769badcf0041894f6c5acc1b94f (diff) | |
download | gdb-6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a.zip gdb-6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a.tar.gz gdb-6cb06a8cdaaf30f5d879f24d37100cf1d25c6a3a.tar.bz2 |
Unify gdb printf functions
Now that filtered and unfiltered output can be treated identically, we
can unify the printf family of functions. This is done under the name
"gdb_printf". Most of this patch was written by script.
Diffstat (limited to 'gdb/c-valprint.c')
-rw-r--r-- | gdb/c-valprint.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index c034704..9a860bf 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -221,7 +221,7 @@ print_unpacked_pointer (struct type *type, struct type *elttype, current_language); if (options->prettyformat) { - fprintf_filtered (stream, "\n"); + gdb_printf (stream, "\n"); print_spaces_filtered (2 + 2 * recurse, stream); } } @@ -298,18 +298,18 @@ c_value_print_array (struct value *val, else { unsigned int i = 0; - fprintf_filtered (stream, "{"); + gdb_printf (stream, "{"); /* If this is a virtual function table, print the 0th entry specially, and the rest of the members normally. */ if (cp_is_vtbl_ptr_type (elttype)) { i = 1; - fprintf_filtered (stream, _("%d vtable entries"), - len - 1); + gdb_printf (stream, _("%d vtable entries"), + len - 1); } value_print_array_elements (val, stream, recurse, options, i); - fprintf_filtered (stream, "}"); + gdb_printf (stream, "}"); } } else @@ -365,7 +365,7 @@ c_value_print_struct (struct value *val, struct ui_file *stream, int recurse, struct type *type = check_typedef (value_type (val)); if (type->code () == TYPE_CODE_UNION && recurse && !options->unionprint) - fprintf_filtered (stream, "{...}"); + gdb_printf (stream, "{...}"); else if (options->vtblprint && cp_is_vtbl_ptr_type (type)) { /* Print the unmangled name if desired. */ @@ -517,7 +517,7 @@ c_value_print (struct value *val, struct ui_file *stream, } /* Pointer to class, check real type of object. */ - fprintf_filtered (stream, "("); + gdb_printf (stream, "("); if (value_entirely_available (val)) { @@ -542,19 +542,19 @@ c_value_print (struct value *val, struct ui_file *stream, type = value_type (val); type_print (type, "", stream, -1); - fprintf_filtered (stream, ") "); + gdb_printf (stream, ") "); } else { /* normal case */ - fprintf_filtered (stream, "("); + gdb_printf (stream, "("); type_print (value_type (val), "", stream, -1); - fprintf_filtered (stream, ") "); + gdb_printf (stream, ") "); } } if (!value_initialized (val)) - fprintf_filtered (stream, " [uninitialized] "); + gdb_printf (stream, " [uninitialized] "); if (options->objectprint && (type->code () == TYPE_CODE_STRUCT)) { @@ -572,15 +572,15 @@ c_value_print (struct value *val, struct ui_file *stream, && (TYPE_LENGTH (real_type) < TYPE_LENGTH (value_enclosing_type (val))))) val = value_cast (real_type, val); - fprintf_filtered (stream, "(%s%s) ", - real_type->name (), - full ? "" : _(" [incomplete object]")); + gdb_printf (stream, "(%s%s) ", + real_type->name (), + full ? "" : _(" [incomplete object]")); } else if (type != check_typedef (value_enclosing_type (val))) { /* No RTTI information, so let's do our best. */ - fprintf_filtered (stream, "(%s ?) ", - value_enclosing_type (val)->name ()); + gdb_printf (stream, "(%s ?) ", + value_enclosing_type (val)->name ()); val = value_cast (value_enclosing_type (val), val); } } |