summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2012-01-29 02:24:39 +0400
committerMax Filippov <jcmvbkbc@gmail.com>2012-02-20 20:07:11 +0400
commit488d65772ce94aa439f26d7136db384aec460bcb (patch)
treeb5f5e760e48708cde05fec17b693fe6ba90cd54e /exec.c
parent673641504780300be2f0553b76bee34e3d643e57 (diff)
downloadqemu-488d65772ce94aa439f26d7136db384aec460bcb.tar.gz
qemu-488d65772ce94aa439f26d7136db384aec460bcb.tar.bz2
qemu-488d65772ce94aa439f26d7136db384aec460bcb.zip
exec: fix check_watchpoint exiting cpu_loop
In case of BP_STOP_BEFORE_ACCESS watchpoint check_watchpoint intends to signal EXCP_DEBUG exception on exit from cpu loop, but later overwrites exception code by the cpu_resume_from_signal call. Use cpu_loop_exit with BP_STOP_BEFORE_ACCESS watchpoints. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/exec.c b/exec.c
index f105b43fd2..ed091f398d 100644
--- a/exec.c
+++ b/exec.c
@@ -3257,11 +3257,12 @@ static void check_watchpoint(int offset, int len_mask, int flags)
tb_phys_invalidate(tb, -1);
if (wp->flags & BP_STOP_BEFORE_ACCESS) {
env->exception_index = EXCP_DEBUG;
+ cpu_loop_exit(env);
} else {
cpu_get_tb_cpu_state(env, &pc, &cs_base, &cpu_flags);
tb_gen_code(env, pc, cs_base, cpu_flags, 1);
+ cpu_resume_from_signal(env, NULL);
}
- cpu_resume_from_signal(env, NULL);
}
} else {
wp->flags &= ~BP_WATCHPOINT_HIT;