Unify gdb puts functions

Now that filtered and unfiltered output can be treated identically, we
can unify the puts family of functions.  This is done under the name
"gdb_puts".  Most of this patch was written by script.
This commit is contained in:
Tom Tromey
2022-01-02 11:36:44 -07:00
parent 19a7b8ab87
commit 0426ad513f
86 changed files with 1196 additions and 1204 deletions

View File

@@ -42,7 +42,7 @@
/* Helper macro. */
#define target_debug_do_print(E) \
fputs_unfiltered ((E), gdb_stdlog);
gdb_puts ((E), gdb_stdlog);
#define target_debug_print_enum_target_object(X) \
target_debug_do_print (plongest (X))
@@ -180,7 +180,7 @@
static void
target_debug_print_struct_target_waitstatus_p (struct target_waitstatus *status)
{
fputs_unfiltered (status->to_string ().c_str (), gdb_stdlog);
gdb_puts (status->to_string ().c_str (), gdb_stdlog);
}
@@ -195,13 +195,13 @@ target_debug_print_target_wait_flags (target_wait_flags options)
{
std::string str = target_options_to_string (options);
fputs_unfiltered (str.c_str (), gdb_stdlog);
gdb_puts (str.c_str (), gdb_stdlog);
}
static void
target_debug_print_signals (gdb::array_view<const unsigned char> sigs)
{
fputs_unfiltered ("{", gdb_stdlog);
gdb_puts ("{", gdb_stdlog);
for (size_t i = 0; i < sigs.size (); i++)
if (sigs[i] != 0)
@@ -209,7 +209,7 @@ target_debug_print_signals (gdb::array_view<const unsigned char> sigs)
fprintf_unfiltered (gdb_stdlog, " %s",
gdb_signal_to_name ((enum gdb_signal) i));
}
fputs_unfiltered (" }", gdb_stdlog);
gdb_puts (" }", gdb_stdlog);
}
static void
@@ -221,14 +221,14 @@ target_debug_print_size_t (size_t size)
static void
target_debug_print_const_gdb_byte_vector_r (const gdb::byte_vector &vector)
{
fputs_unfiltered ("{", gdb_stdlog);
gdb_puts ("{", gdb_stdlog);
for (size_t i = 0; i < vector.size (); i++)
{
fprintf_unfiltered (gdb_stdlog, " %s",
phex_nz (vector[i], 1));
}
fputs_unfiltered (" }", gdb_stdlog);
gdb_puts (" }", gdb_stdlog);
}
static void