aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-12-24 22:31:53 -0700
committerTom Tromey <tom@tromey.com>2022-01-05 11:36:33 -0700
commitb58f47ab4cae11166f210f54bca6e7c58b855a0f (patch)
tree71a3a29e7574066997f1e5c6ef4df785ad928f98 /gdb/cli
parentb68178b9cbbef2aa4e234db4313ac8ba6d1dc04c (diff)
downloadgdb-b58f47ab4cae11166f210f54bca6e7c58b855a0f.zip
gdb-b58f47ab4cae11166f210f54bca6e7c58b855a0f.tar.gz
gdb-b58f47ab4cae11166f210f54bca6e7c58b855a0f.tar.bz2
Use filtered output in ordinary commands
Many otherwise ordinary commands choose to use unfiltered output rather than filtered. I don't think there's any reason for this, so this changes many such commands to use filtered output instead. Note that complete_command is not touched due to a comment there explaining why unfiltered output is believed to be used.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c14
-rw-r--r--gdb/cli/cli-logging.c24
2 files changed, 19 insertions, 19 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index ea191cb..e62e7a9 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -501,14 +501,14 @@ pwd_command (const char *args, int from_tty)
safe_strerror (errno));
if (strcmp (cwd.get (), current_directory) != 0)
- printf_unfiltered (_("Working directory %ps\n (canonically %ps).\n"),
- styled_string (file_name_style.style (),
- current_directory),
- styled_string (file_name_style.style (), cwd.get ()));
+ printf_filtered (_("Working directory %ps\n (canonically %ps).\n"),
+ styled_string (file_name_style.style (),
+ current_directory),
+ styled_string (file_name_style.style (), cwd.get ()));
else
- printf_unfiltered (_("Working directory %ps.\n"),
- styled_string (file_name_style.style (),
- current_directory));
+ printf_filtered (_("Working directory %ps.\n"),
+ styled_string (file_name_style.style (),
+ current_directory));
}
void
diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c
index ea486d8..bf12b1a 100644
--- a/gdb/cli/cli-logging.c
+++ b/gdb/cli/cli-logging.c
@@ -115,8 +115,8 @@ handle_redirections (int from_tty)
{
if (!saved_filename.empty ())
{
- fprintf_unfiltered (gdb_stdout, "Already logging to %s.\n",
- saved_filename.c_str ());
+ printf_filtered ("Already logging to %s.\n",
+ saved_filename.c_str ());
return;
}
@@ -128,18 +128,18 @@ handle_redirections (int from_tty)
if (from_tty)
{
if (!logging_redirect)
- fprintf_unfiltered (gdb_stdout, "Copying output to %s.\n",
- logging_filename.c_str ());
+ printf_filtered ("Copying output to %s.\n",
+ logging_filename.c_str ());
else
- fprintf_unfiltered (gdb_stdout, "Redirecting output to %s.\n",
- logging_filename.c_str ());
+ printf_filtered ("Redirecting output to %s.\n",
+ logging_filename.c_str ());
if (!debug_redirect)
- fprintf_unfiltered (gdb_stdout, "Copying debug output to %s.\n",
- logging_filename.c_str ());
+ printf_filtered ("Copying debug output to %s.\n",
+ logging_filename.c_str ());
else
- fprintf_unfiltered (gdb_stdout, "Redirecting debug output to %s.\n",
- logging_filename.c_str ());
+ printf_filtered ("Redirecting debug output to %s.\n",
+ logging_filename.c_str ());
}
saved_filename = logging_filename;
@@ -177,8 +177,8 @@ set_logging_off (const char *args, int from_tty)
pop_output_files ();
if (from_tty)
- fprintf_unfiltered (gdb_stdout, "Done logging to %s.\n",
- saved_filename.c_str ());
+ printf_filtered ("Done logging to %s.\n",
+ saved_filename.c_str ());
saved_filename.clear ();
}