This is required by the GDB remote protocol. Signed-off-by: Ilya Leoshkevich <i...@linux.ibm.com> --- gdbstub/gdbstub.c | 2 ++ gdbstub/user.c | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index a096104b07a..be632f8b214 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -2497,6 +2497,8 @@ bool gdb_try_stop(void) return false; } + pause_all_vcpus(); + gdbserver_state.allow_stop_reply = false; return true; } diff --git a/gdbstub/user.c b/gdbstub/user.c index 82007b09db6..3095c846a99 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -458,6 +458,7 @@ static void disable_gdbstub(CPUState *thread_cpu) cpu_breakpoint_remove_all(cpu, BP_GDB); /* no cpu_watchpoint_remove_all for user-mode */ cpu_single_step(cpu, 0); + cpu_resume(cpu); } tb_flush(thread_cpu); } @@ -650,9 +651,16 @@ int gdb_continue_partial(char *newstates) * previous situation, where only one CPU would be single-stepped. */ CPU_FOREACH(cpu) { - if (newstates[cpu->cpu_index] == 's') { + switch (newstates[cpu->cpu_index]) { + case 's': trace_gdbstub_op_stepping(cpu->cpu_index); cpu_single_step(cpu, gdbserver_state.sstep_flags); + QEMU_FALLTHROUGH; + case 'c': + case 'C': + case 'S': + cpu_resume(cpu); + break; } } gdbserver_user_state.running_state = 1; -- 2.46.0