diff options
author | Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> | 2014-10-22 15:38:31 +0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-10-31 16:41:05 +0100 |
commit | e64e353590c2584b41cd1db925f67042a05f4250 (patch) | |
tree | 0eaa446b1f94f72bb497d43dfdbaa7c61da18eab /target-i386/translate.c | |
parent | 4725398f9309d05936fec2eaaa6e97e01e25545e (diff) |
i386: fix breakpoints handling in icount mode
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 <pavel.dovgaluk@ispras.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Diffstat (limited to 'target-i386/translate.c')
-rw-r--r-- | 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 418173e0ea..782f7d2666 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 */ |