Send arch-utils error messages to gdb_stderr
authorTom Tromey <tom@tromey.com>
Mon, 27 Dec 2021 04:51:25 +0000 (21:51 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 29 Dec 2021 17:40:10 +0000 (10:40 -0700)
This changes arch-utils.c to send some error messages to gdb_stderr.
This is part of PR gdb/7233.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233

gdb/arch-utils.c

index 4442ec9b82f4199abf80fd33988e43a5a5254241..fb92b993c78e9281db6f5494c6da47509b0ba43c 100644 (file)
@@ -405,7 +405,8 @@ set_endian (const char *ignore_args, int from_tty, struct cmd_list_element *c)
     {
       info.byte_order = BFD_ENDIAN_LITTLE;
       if (! gdbarch_update_p (info))
-       printf_unfiltered (_("Little endian target not supported by GDB\n"));
+       fprintf_unfiltered (gdb_stderr,
+                           _("Little endian target not supported by GDB\n"));
       else
        target_byte_order_user = BFD_ENDIAN_LITTLE;
     }
@@ -413,7 +414,8 @@ set_endian (const char *ignore_args, int from_tty, struct cmd_list_element *c)
     {
       info.byte_order = BFD_ENDIAN_BIG;
       if (! gdbarch_update_p (info))
-       printf_unfiltered (_("Big endian target not supported by GDB\n"));
+       fprintf_unfiltered (gdb_stderr,
+                           _("Big endian target not supported by GDB\n"));
       else
        target_byte_order_user = BFD_ENDIAN_BIG;
     }
@@ -567,8 +569,9 @@ set_architecture (const char *ignore_args,
       if (gdbarch_update_p (info))
        target_architecture_user = info.bfd_arch_info;
       else
-       printf_unfiltered (_("Architecture `%s' not recognized.\n"),
-                          set_architecture_string);
+       fprintf_unfiltered (gdb_stderr,
+                           _("Architecture `%s' not recognized.\n"),
+                           set_architecture_string);
     }
   show_architecture (gdb_stdout, from_tty, NULL, NULL);
 }