]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use filtered output in terminal_info implementations
authorTom Tromey <tom@tromey.com>
Mon, 27 Dec 2021 01:33:12 +0000 (18:33 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 5 Jan 2022 18:36:33 +0000 (11:36 -0700)
This changes one terminal_info implementation, and
default_terminal_info, to use filtered output.  Other implementations
of this method already use filtered output.

I can't compile go32-nat.c, so this is a 'best effort' patch.

gdb/go32-nat.c
gdb/target.c

index 204c21210062cb4fe21966dda524b649977627ce..91fae3dd7f474d071f64a038aa79661175f5ad2a 100644 (file)
@@ -899,9 +899,9 @@ go32_nat_target::terminal_init ()
 void
 go32_nat_target::terminal_info (const char *args, int from_tty)
 {
-  printf_unfiltered ("Inferior's terminal is in %s mode.\n",
-                    !inf_mode_valid
-                    ? "default" : inf_terminal_mode ? "raw" : "cooked");
+  printf_filtered ("Inferior's terminal is in %s mode.\n",
+                  !inf_mode_valid
+                  ? "default" : inf_terminal_mode ? "raw" : "cooked");
 
 #if __DJGPP_MINOR__ > 2
   if (child_cmd.redirection)
@@ -911,15 +911,15 @@ go32_nat_target::terminal_info (const char *args, int from_tty)
       for (i = 0; i < DBG_HANDLES; i++)
        {
          if (child_cmd.redirection[i]->file_name)
-           printf_unfiltered ("\tFile handle %d is redirected to `%s'.\n",
-                              i, child_cmd.redirection[i]->file_name);
+           printf_filtered ("\tFile handle %d is redirected to `%s'.\n",
+                            i, child_cmd.redirection[i]->file_name);
          else if (_get_dev_info (child_cmd.redirection[i]->inf_handle) == -1)
-           printf_unfiltered
+           printf_filtered
              ("\tFile handle %d appears to be closed by inferior.\n", i);
          /* Mask off the raw/cooked bit when comparing device info words.  */
          else if ((_get_dev_info (child_cmd.redirection[i]->inf_handle) & 0xdf)
                   != (_get_dev_info (i) & 0xdf))
-           printf_unfiltered
+           printf_filtered
              ("\tFile handle %d appears to be redirected by inferior.\n", i);
        }
     }
index b3b1bbd06b2484a9ab9ab810ea2b2e6cfdacbeb2..1a072297fa6678e531a66e71c4ad0309acff2fe5 100644 (file)
@@ -1127,7 +1127,7 @@ noprocess (void)
 static void
 default_terminal_info (struct target_ops *self, const char *args, int from_tty)
 {
-  printf_unfiltered (_("No saved terminal information.\n"));
+  printf_filtered (_("No saved terminal information.\n"));
 }
 
 /* A default implementation for the to_get_ada_task_ptid target method.