This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Use target_terminal_ours_for_output in cp-support.c
- From: Pedro Alves <palves at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 12 Apr 2016 16:11:36 -0000
- Subject: [binutils-gdb] Use target_terminal_ours_for_output in cp-support.c
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c509f1e1e8187e0abd2321aadc37878402c87332
commit c509f1e1e8187e0abd2321aadc37878402c87332
Author: Pedro Alves <palves@redhat.com>
Date: Tue Apr 12 16:49:31 2016 +0100
Use target_terminal_ours_for_output in cp-support.c
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.
Diff:
---
gdb/ChangeLog | 6 ++++++
gdb/cp-support.c | 4 +++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8fd8ea8..cdaf648 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
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
functions.
(ada_lookup_struct_elt_type): Use type_as_string_and_cleanup.
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index a71c6ad..c7f5074 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -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,