This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Initialize terminal_state to terminal_is_ours
- From: Patrick Palka <ppalka at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 29 Jul 2015 12:28:39 -0000
- Subject: [binutils-gdb] Initialize terminal_state to terminal_is_ours
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7afa63c624ae570472381b8e35ce066bf145844a
commit 7afa63c624ae570472381b8e35ce066bf145844a
Author: Patrick Palka <patrick@parcs.ath.cx>
Date: Tue Jul 28 13:58:17 2015 -0400
Initialize terminal_state to terminal_is_ours
Right now this variable is initialized to 0 i.e. terminal_is_inferior
and does not get set to terminal_is_ours until target_terminal_init() is
called. This function however only gets called when an inferior is
first created. In the meantime, terminal_state would wrongly remain set
to terminal_is_inferior.
Tested on x86_64 Debian Stretch -- native, gdbserver and
extended-gdbserver.
gdb/ChangeLog:
* target.c (terminal_state): Initialize to terminal_is_ours.
Diff:
---
gdb/ChangeLog | 4 ++++
gdb/target.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 56ebcc6..2e62184 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2015-07-29 Patrick Palka <patrick@parcs.ath.cx>
+
+ * target.c (terminal_state): Initialize to terminal_is_ours.
+
2015-07-29 Yao Qi <yao.qi@linaro.org>
PR record/18691
diff --git a/gdb/target.c b/gdb/target.c
index 01bac7e..c671e7c 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -444,7 +444,7 @@ enum terminal_state
terminal_is_ours = 2
};
-static enum terminal_state terminal_state;
+static enum terminal_state terminal_state = terminal_is_ours;
/* See target.h. */