Skip to content

Commit

Permalink
linux-user/s390x: Fix single-stepping SVC
Browse files Browse the repository at this point in the history
Currently single-stepping SVC executes two instructions. The reason is
that EXCP_DEBUG for the SVC instruction itself is masked by EXCP_SVC.
Fix by re-raising EXCP_DEBUG.

Signed-off-by: Ilya Leoshkevich <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
(cherry picked from commit 01b9990a3fb84bb9a14017255ab1a4fa86588215)
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
iii-i authored and Michael Tokarev committed Jun 7, 2023
1 parent 82fc148 commit 5502e5c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions linux-user/s390x/cpu_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ void cpu_loop(CPUS390XState *env)
} else if (ret != -QEMU_ESIGRETURN) {
env->regs[2] = ret;
}

if (unlikely(cs->singlestep_enabled)) {
/*
* cpu_tb_exec() did not raise EXCP_DEBUG, because it has seen
* that EXCP_SVC was already pending.
*/
cs->exception_index = EXCP_DEBUG;
}

break;

case EXCP_DEBUG:
Expand Down

0 comments on commit 5502e5c

Please sign in to comment.