qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] i386: fix breakpoints handling in icount mode
@ 2014-10-22 11:38 Pavel Dovgalyuk
  2014-10-22 12:53 ` Frederic Konrad
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Pavel Dovgalyuk @ 2014-10-22 11:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: mark.burton, batuzovk, maria.klimushenkova, pavel.dovgaluk,
	pbonzini, zealot351, fred.konrad

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>
---
 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);

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-05-26 14:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-22 11:38 [Qemu-devel] [PATCH] i386: fix breakpoints handling in icount mode Pavel Dovgalyuk
2014-10-22 12:53 ` Frederic Konrad
2014-10-23  5:57   ` Pavel Dovgaluk
2014-10-23  7:39     ` Frederic Konrad
2014-10-23  7:52       ` Pavel Dovgaluk
2014-10-23  8:47         ` Frederic Konrad
2014-10-23  9:58           ` Pavel Dovgaluk
2014-10-31 15:41 ` Paolo Bonzini
2015-01-12  8:03 ` Jan Kiszka
2015-01-12  8:26   ` Pavel Dovgaluk
2015-01-12  8:30     ` Jan Kiszka
2015-01-12  8:55       ` Paolo Bonzini
2015-05-24 14:43         ` Jan Kiszka
2015-05-26 14:56           ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).