From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkELT-00045e-Vv for qemu-devel@nongnu.org; Fri, 31 Oct 2014 11:43:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XkEKP-0003ji-JC for qemu-devel@nongnu.org; Fri, 31 Oct 2014 11:42:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39264) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkEKP-0003jc-Co for qemu-devel@nongnu.org; Fri, 31 Oct 2014 11:41:29 -0400 Message-ID: <5453AD9B.1080506@redhat.com> Date: Fri, 31 Oct 2014 16:41:15 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <20141022113831.9548.36452.stgit@PASHA-ISP> In-Reply-To: <20141022113831.9548.36452.stgit@PASHA-ISP> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] i386: fix breakpoints handling in icount mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: fred.konrad@greensocs.com, zealot351@gmail.com, maria.klimushenkova@ispras.ru, mark.burton@greensocs.com, batuzovk@ispras.ru On 22/10/2014 13:38, Pavel Dovgalyuk wrote: > 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 > --- > target-i386/translate.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/target-i386/translate.c b/target-i386/translate.c > index 1284173..193cf9f 100644 > --- a/target-i386/translate.c > +++ b/target-i386/translate.c > @@ -8000,7 +8000,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; > } > } > } > @@ -8049,6 +8049,7 @@ static inline void gen_intermediate_code_internal(X86CPU *cpu, > break; > } > } > +done_generating: > if (tb->cflags & CF_LAST_IO) > gen_io_end(); > gen_tb_end(tb, num_insns); > Applied, thanks. Paolo