]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use filtered output in show callbacks
authorTom Tromey <tom@tromey.com>
Wed, 29 Dec 2021 18:05:51 +0000 (11:05 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 29 Dec 2021 18:08:14 +0000 (11:08 -0700)
"show" command callbacks, like most ordinary gdb commands, should use
filtered output.  I found a few that did not, so this patch changes
them to use the filtered form.

gdb/arch-utils.c
gdb/arm-tdep.c
gdb/cli/cli-logging.c
gdb/debuginfod-support.c

index fb92b993c78e9281db6f5494c6da47509b0ba43c..63c3c6cce728ce19d0dfab541e1ade90a917177b 100644 (file)
@@ -375,18 +375,18 @@ show_endian (struct ui_file *file, int from_tty, struct cmd_list_element *c,
 {
   if (target_byte_order_user == BFD_ENDIAN_UNKNOWN)
     if (gdbarch_byte_order (get_current_arch ()) == BFD_ENDIAN_BIG)
-      fprintf_unfiltered (file, _("The target endianness is set automatically "
-                                 "(currently big endian).\n"));
+      fprintf_filtered (file, _("The target endianness is set automatically "
+                               "(currently big endian).\n"));
     else
-      fprintf_unfiltered (file, _("The target endianness is set automatically "
-                                 "(currently little endian).\n"));
+      fprintf_filtered (file, _("The target endianness is set automatically "
+                               "(currently little endian).\n"));
   else
     if (target_byte_order_user == BFD_ENDIAN_BIG)
-      fprintf_unfiltered (file,
-                         _("The target is set to big endian.\n"));
+      fprintf_filtered (file,
+                       _("The target is set to big endian.\n"));
     else
-      fprintf_unfiltered (file,
-                         _("The target is set to little endian.\n"));
+      fprintf_filtered (file,
+                       _("The target is set to little endian.\n"));
 }
 
 static void
index e4af38ce8b429ea5149de3fee00628be1bef5109..1068a0c0c9be7fd549ca74180bff3bc9e3b24c7a 100644 (file)
@@ -8623,7 +8623,7 @@ show_disassembly_style_sfunc (struct ui_file *file, int from_tty,
        len = strcspn (style, ",");
       }
 
-  fprintf_unfiltered (file, "The disassembly style is \"%.*s\".\n", len, style);
+  fprintf_filtered (file, "The disassembly style is \"%.*s\".\n", len, style);
 }
 \f
 /* Return the ARM register name corresponding to register I.  */
index bad4d1a22e923a8d09ed26ddce9aeeb2986a789c..9afd51e352a30201859529b2ac5f4eda77b1403e 100644 (file)
@@ -181,9 +181,9 @@ show_logging_enabled (struct ui_file *file, int from_tty,
                       struct cmd_list_element *c, const char *value)
 {
   if (logging_enabled)
-    fprintf_unfiltered (file, _("Logging is enabled.\n"));
+    fprintf_filtered (file, _("Logging is enabled.\n"));
   else
-    fprintf_unfiltered (file, _("Logging is disabled.\n"));
+    fprintf_filtered (file, _("Logging is disabled.\n"));
 }
 
 void _initialize_cli_logging ();
index 633cfdb6aea76efc0124cbb3439e771b8431a5e2..85abd721ac3f8ce437904e4f1f802101cd7d390d 100644 (file)
@@ -299,9 +299,9 @@ static void
 show_debuginfod_enabled (ui_file *file, int from_tty, cmd_list_element *cmd,
                         const char *value)
 {
-  fprintf_unfiltered (file,
-                     _("Debuginfod functionality is currently set to "
-                       "\"%s\".\n"), debuginfod_enabled);
+  fprintf_filtered (file,
+                   _("Debuginfod functionality is currently set to "
+                     "\"%s\".\n"), debuginfod_enabled);
 }
 
 /* Set callback for "set debuginfod urls".  */
@@ -342,7 +342,7 @@ show_debuginfod_urls (ui_file *file, int from_tty, cmd_list_element *cmd,
                      const char *value)
 {
   if (value[0] == '\0')
-    fprintf_unfiltered (file, _("Debuginfod URLs have not been set.\n"));
+    fprintf_filtered (file, _("Debuginfod URLs have not been set.\n"));
   else
     fprintf_filtered (file, _("Debuginfod URLs are currently set to:\n%s\n"),
                      value);