aboutsummaryrefslogtreecommitdiff
path: root/gdb/event-loop.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-11-19 18:09:43 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-01-24 00:11:52 +0000
commitf3364a6d0fefe44fc26a1d5025b3af55ecec5cad (patch)
tree98a9b7a3b11bec69543e3a6f1a5a8f18ce1cb682 /gdb/event-loop.c
parent733d0a679536628eb1be4b4b8aa6384de24ff1f1 (diff)
downloadbinutils-f3364a6d0fefe44fc26a1d5025b3af55ecec5cad.zip
binutils-f3364a6d0fefe44fc26a1d5025b3af55ecec5cad.tar.gz
binutils-f3364a6d0fefe44fc26a1d5025b3af55ecec5cad.tar.bz2
gdb: Re-enable stdin for all UIs from start_event_loop
If we catch an exception in start_event_loop's call to gdb_do_one_event, then it is possible that the current_ui has changed since we called async_disable_stdin. If that's the case then calling async_enable_stdin will be called on the wrong UI. To solve this problem we wrap the call to async_enable_stdin with SWITCH_THRU_ALL_UIS, this causes us to try and re-enable stdin for all UIs, which will catch any for which we called async_disable_stdin. gdb/ChangeLog: * event-loop.c (start_event_loop): Wrap async_enable_stdin with SWITCH_THRU_ALL_UIS. gdb/testsuite/ChangeLog: * gdb.server/multi-ui-errors.c: New file. * gdb.server/multi-ui-errors.exp: New file. Change-Id: I1e18deff2e6f4e17f7a13adce3553eb001cad93b
Diffstat (limited to 'gdb/event-loop.c')
-rw-r--r--gdb/event-loop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index 32f4cca..65a35b4 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -376,7 +376,10 @@ start_event_loop (void)
/* If any exception escaped to here, we better enable
stdin. Otherwise, any command that calls async_disable_stdin,
and then throws, will leave stdin inoperable. */
- async_enable_stdin ();
+ SWITCH_THRU_ALL_UIS ()
+ {
+ async_enable_stdin ();
+ }
/* If we long-jumped out of do_one_event, we probably didn't
get around to resetting the prompt, which leaves readline
in a messed-up state. Reset it here. */