From a03743453101edf0badda39f25d30736d184973b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 26 Dec 2021 18:14:39 -0700 Subject: [PATCH] Use filtered output in files_info implementations This changes the implementations of the target files_info method to use filtered output. This makes sense because the sole caller of this method is an ordinary command (info_program_command). This patch changes this command to use filtered output as well. --- gdb/go32-nat.c | 2 +- gdb/nto-procfs.c | 8 ++++---- gdb/remote-sim.c | 4 ++-- gdb/target.c | 10 +++++----- gdb/windows-nat.c | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index 970e9e00c54..204c2121006 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -663,7 +663,7 @@ static cmdline_t child_cmd; /* Parsed child's command line kept here. */ void go32_nat_target::files_info () { - printf_unfiltered ("You are running a DJGPP V2 program.\n"); + printf_filtered ("You are running a DJGPP V2 program.\n"); } void diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index 7ae71d9d519..bf869df1dab 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -656,10 +656,10 @@ nto_procfs_target::files_info () { struct inferior *inf = current_inferior (); - printf_unfiltered ("\tUsing the running image of %s %s via %s.\n", - inf->attach_flag ? "attached" : "child", - target_pid_to_str (inferior_ptid).c_str (), - (nodestr != NULL) ? nodestr : "local node"); + printf_filtered ("\tUsing the running image of %s %s via %s.\n", + inf->attach_flag ? "attached" : "child", + target_pid_to_str (inferior_ptid).c_str (), + (nodestr != NULL) ? nodestr : "local node"); } /* Target to_pid_to_exec_file implementation. */ diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 7a029c93e91..3637fdb18bf 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -1114,8 +1114,8 @@ gdbsim_target::files_info () if (current_program_space->exec_bfd ()) { - fprintf_unfiltered (gdb_stdlog, "\tAttached to %s running program %s\n", - target_shortname (), file); + printf_filtered ("\tAttached to %s running program %s\n", + target_shortname (), file); sim_info (sim_data->gdbsim_desc, 0); } } diff --git a/gdb/target.c b/gdb/target.c index e10b295c797..b3b1bbd06b2 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -2444,8 +2444,8 @@ info_target_command (const char *args, int from_tty) if (current_program_space->symfile_object_file != NULL) { objfile *objf = current_program_space->symfile_object_file; - printf_unfiltered (_("Symbols from \"%s\".\n"), - objfile_name (objf)); + printf_filtered (_("Symbols from \"%s\".\n"), + objfile_name (objf)); } for (target_ops *t = current_inferior ()->top_target (); @@ -2458,9 +2458,9 @@ info_target_command (const char *args, int from_tty) if ((int) (t->stratum ()) <= (int) dummy_stratum) continue; if (has_all_mem) - printf_unfiltered (_("\tWhile running this, " - "GDB does not access memory from...\n")); - printf_unfiltered ("%s:\n", t->longname ()); + printf_filtered (_("\tWhile running this, " + "GDB does not access memory from...\n")); + printf_filtered ("%s:\n", t->longname ()); t->files_info (); has_all_mem = t->has_all_memory (); } diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 76332541f8e..03447e0922a 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -2090,9 +2090,9 @@ windows_nat_target::files_info () { struct inferior *inf = current_inferior (); - printf_unfiltered ("\tUsing the running image of %s %s.\n", - inf->attach_flag ? "attached" : "child", - target_pid_to_str (inferior_ptid).c_str ()); + printf_filtered ("\tUsing the running image of %s %s.\n", + inf->attach_flag ? "attached" : "child", + target_pid_to_str (inferior_ptid).c_str ()); } /* Modify CreateProcess parameters for use of a new separate console. -- 2.30.2