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.
This commit is contained in:
Patrick Palka 2015-07-28 13:58:17 -04:00
parent 90074d118d
commit 7afa63c624
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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. */