Use target_terminal_ours_for_output in cp-support.c
authorPedro Alves <palves@redhat.com>
Tue, 12 Apr 2016 15:49:31 +0000 (16:49 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 12 Apr 2016 15:58:14 +0000 (16:58 +0100)
We're only doing output here, so leave raw/cooked mode alone, as well
as the SIGINT handler.

Restore terminal settings after output, while at it.

gdb/ChangeLog:
2016-04-12  Pedro Alves  <palves@redhat.com>

* cp-support.c (gdb_demangle): Use target_terminal_ours_for_output
instead of target_terminal_ours, and restore target terminal with
a cleanup.

gdb/ChangeLog
gdb/cp-support.c

index 8fd8ea825e0d7bc83920c6ee9250d7ecd692b5cd..cdaf648949465c457125193f674c2e934871e933 100644 (file)
@@ -1,3 +1,9 @@
+2016-04-12  Pedro Alves  <palves@redhat.com>
+
+       * cp-support.c (gdb_demangle): Use target_terminal_ours_for_output
+       instead of target_terminal_ours, and restore target terminal with
+       a cleanup.
+
 2016-04-12  Pedro Alves  <palves@redhat.com>
 
        * ada-lang.c (type_as_string, type_as_string_and_cleanup): New
index a71c6ad722743d982bd07869e08176e07388dda9..c7f507435f77dd13e01a14f86e806e20b5520a6b 100644 (file)
@@ -1601,7 +1601,9 @@ gdb_demangle (const char *name, int options)
                                    "demangler-warning", short_msg);
              make_cleanup (xfree, long_msg);
 
-             target_terminal_ours ();
+             make_cleanup_restore_target_terminal ();
+             target_terminal_ours_for_output ();
+
              begin_line ();
              if (core_dump_allowed)
                fprintf_unfiltered (gdb_stderr,