aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 0374533..d270664 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -735,6 +735,24 @@ continue_1 (int all_threads)
iterate_over_threads (proceed_thread_callback, NULL);
+ if (sync_execution)
+ {
+ /* If all threads in the target were already running,
+ proceed_thread_callback ends up never calling proceed,
+ and so nothing calls this to put the inferior's terminal
+ settings in effect and remove stdin from the event loop,
+ which we must when running a foreground command. E.g.:
+
+ (gdb) c -a&
+ Continuing.
+ <all threads are running now>
+ (gdb) c -a
+ Continuing.
+ <no thread was resumed, but the inferior now owns the terminal>
+ */
+ target_terminal_inferior ();
+ }
+
/* Restore selected ptid. */
do_cleanups (old_chain);
}