From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkFyv-00074G-Rz for qemu-devel@nongnu.org; Fri, 31 Oct 2014 13:27:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XkFyq-000829-U1 for qemu-devel@nongnu.org; Fri, 31 Oct 2014 13:27:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkFyq-000825-N5 for qemu-devel@nongnu.org; Fri, 31 Oct 2014 13:27:20 -0400 From: Paolo Bonzini Date: Fri, 31 Oct 2014 18:26:07 +0100 Message-Id: <1414776373-9704-30-git-send-email-pbonzini@redhat.com> In-Reply-To: <1414776373-9704-1-git-send-email-pbonzini@redhat.com> References: <1414776373-9704-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 29/35] i386: fix breakpoints handling in icount mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Pavel Dovgalyuk From: Pavel Dovgalyuk This patch fixes instructions counting when execution is stopped on breakpoint (e.g. set from gdb). Without a patch extra instruction is translated and icount is incremented by invalid value (which equals to number of executed instructions + 1). Signed-off-by: Pavel Dovgalyuk Signed-off-by: Paolo Bonzini Signed-off-by: Pavel Dovgalyuk --- target-i386/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 418173e..782f7d2 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -7987,7 +7987,7 @@ static inline void gen_intermediate_code_internal(X86CPU *cpu, if (bp->pc == pc_ptr && !((bp->flags & BP_CPU) && (tb->flags & HF_RF_MASK))) { gen_debug(dc, pc_ptr - dc->cs_base); - break; + goto done_generating; } } } @@ -8038,6 +8038,7 @@ static inline void gen_intermediate_code_internal(X86CPU *cpu, } if (tb->cflags & CF_LAST_IO) gen_io_end(); +done_generating: gen_tb_end(tb, num_insns); *tcg_ctx.gen_opc_ptr = INDEX_op_end; /* we don't forget to fill the last values */ -- 1.8.3.1