aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 8489434..fe4b1d0 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -418,7 +418,8 @@ execute_command (char *p, int from_tty)
/* If the target is running, we allow only a limited set of
commands. */
if (target_can_async_p ()
- && any_running ()
+ && ((!non_stop && any_running ())
+ || (non_stop && is_running (inferior_ptid)))
&& !get_cmd_async_ok (c))
error (_("Cannot execute this command while the target is running."));