From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rynpf-0004lo-0b for qemu-devel@nongnu.org; Sat, 18 Feb 2012 12:12:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rynpd-0005qf-MP for qemu-devel@nongnu.org; Sat, 18 Feb 2012 12:12:22 -0500 Received: from mail-bk0-f45.google.com ([209.85.214.45]:63774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rynpd-0005kY-9Y for qemu-devel@nongnu.org; Sat, 18 Feb 2012 12:12:21 -0500 Received: by mail-bk0-f45.google.com with SMTP id e19so4291536bku.4 for ; Sat, 18 Feb 2012 09:12:20 -0800 (PST) From: Max Filippov Date: Sat, 18 Feb 2012 21:11:39 +0400 Message-Id: <1329585103-31371-8-git-send-email-jcmvbkbc@gmail.com> In-Reply-To: <1329585103-31371-1-git-send-email-jcmvbkbc@gmail.com> References: <1329564636-29883-1-git-send-email-jcmvbkbc@gmail.com> <1329585103-31371-1-git-send-email-jcmvbkbc@gmail.com> Subject: [Qemu-devel] [PATCH 08/12] exec: fix check_watchpoint exiting cpu_loop List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com, Max Filippov , aliguori@us.ibm.com, afaerber@suse.de 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 --- exec.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/exec.c b/exec.c index f105b43..ed091f3 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; -- 1.7.7.6