The current method of executing atomic code in a guest uses cpu_exec_step_atomic() from the outermost loop. This causes an abort() when single stepping over atomic code since debug exception longjmp will point to the the setlongjmp in cpu_exec(). Properly set jmp_env so that it jumps back here on an exception.
CC: Alex Bennée <alex.ben...@linaro.org> CC: Richard Henderson <r...@twiddle.net> CC: Paolo Bonzini <pbonz...@redhat.com> Signed-off-by: Pranith Kumar <bobby.pr...@gmail.com> --- cpu-exec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index 9200c643c2..e61f5747c8 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -242,9 +242,12 @@ static void cpu_exec_step(CPUState *cpu) tb_unlock(); cc->cpu_exec_enter(cpu); - /* execute the generated code */ - trace_exec_tb_nocache(tb, pc); - cpu_tb_exec(cpu, tb); + + if (sigsetjmp(cpu->jmp_env, 0) == 0) { + /* execute the generated code */ + trace_exec_tb_nocache(tb, pc); + cpu_tb_exec(cpu, tb); + } cc->cpu_exec_exit(cpu); tb_lock(); -- 2.11.0