* [PATCH] Initialize terminal_state to terminal_is_ours
@ 2015-07-28 18:18 Patrick Palka
2015-07-28 23:24 ` Pedro Alves
0 siblings, 1 reply; 2+ messages in thread
From: Patrick Palka @ 2015-07-28 18:18 UTC (permalink / raw)
To: gdb-patches; +Cc: Patrick Palka
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 only gets called when an inferiro is first
created. In the meantime however, terminal_state would wrongly remain
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.
---
gdb/target.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/target.c b/gdb/target.c
index 4e2d005..a39201d 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. */
--
2.5.0.rc2.22.g69b1679.dirty
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Initialize terminal_state to terminal_is_ours
2015-07-28 18:18 [PATCH] Initialize terminal_state to terminal_is_ours Patrick Palka
@ 2015-07-28 23:24 ` Pedro Alves
0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2015-07-28 23:24 UTC (permalink / raw)
To: Patrick Palka, gdb-patches
On 07/28/2015 07:17 PM, Patrick Palka wrote:
> 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 only gets called when an inferiro is first
> created. In the meantime however, terminal_state would wrongly remain
> 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.
Whoops. OK.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-07-28 23:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28 18:18 [PATCH] Initialize terminal_state to terminal_is_ours Patrick Palka
2015-07-28 23:24 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox