Skip to content

Commit

Permalink
target-arm: Fix gdb singlestep handling in arm_debug_excp_handler()
Browse files Browse the repository at this point in the history
Do not raise a CPU exception if no CPU breakpoint has fired, since
singlestep is also done by generating a debug internal exception. This
fixes a bug with singlestepping in gdbstub.

Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com>
Message-id: 1446726361-18328-1-git-send-email-serge.fdrv@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
sergefdrv authored and pm215 committed Nov 10, 2015
1 parent a8b4f95 commit 5c629f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion target-arm/op_helper.c
Expand Up @@ -917,7 +917,13 @@ void arm_debug_excp_handler(CPUState *cs)
uint64_t pc = is_a64(env) ? env->pc : env->regs[15];
bool same_el = (arm_debug_target_el(env) == arm_current_el(env));

if (cpu_breakpoint_test(cs, pc, BP_GDB)) {
/* (1) GDB breakpoints should be handled first.
* (2) Do not raise a CPU exception if no CPU breakpoint has fired,
* since singlestep is also done by generating a debug internal
* exception.
*/
if (cpu_breakpoint_test(cs, pc, BP_GDB)
|| !cpu_breakpoint_test(cs, pc, BP_CPU)) {
return;
}

Expand Down

0 comments on commit 5c629f4

Please sign in to comment.