qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] flush TB on singlestep command
@ 2010-04-16  1:03 Jun Koi
  2010-04-16 21:13 ` Stefan Weil
  0 siblings, 1 reply; 16+ messages in thread
From: Jun Koi @ 2010-04-16  1:03 UTC (permalink / raw)
  To: qemu-devel, Jan Kiszka

(Thanks to Jan for comments on the last patch)

Qemu has a command named singlestep, which reduces the translated code
block to be only one instruction.
However, there is one flaw when this command is triggered via monitor
interface: we do not flush all the current TBs, so we will miss
single-step on already translated code.
This patch fixes the problem by flushing all the TB to force new code
generation.

Signed-off-by: Jun Koi <junkoi2004@gmail.com>



diff --git a/monitor.c b/monitor.c
index 5659991..948b861 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1190,8 +1190,14 @@ static void do_log(Monitor *mon, const QDict *qdict)
 static void do_singlestep(Monitor *mon, const QDict *qdict)
 {
     const char *option = qdict_get_try_str(qdict, "option");
+    CPUState *env;
+
     if (!option || !strcmp(option, "on")) {
         singlestep = 1;
+        /* flush all the TBs to force new code generation */
+        for (env = first_cpu; env != NULL; env = env->next_cpu) {
+            tb_flush(env);
+        }
     } else if (!strcmp(option, "off")) {
         singlestep = 0;
     } else {

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

end of thread, other threads:[~2010-04-28 18:06 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-16  1:03 [Qemu-devel] [PATCH] flush TB on singlestep command Jun Koi
2010-04-16 21:13 ` Stefan Weil
2010-04-20  1:17   ` Jun Koi
2010-04-20  7:18     ` [Qemu-devel] " Jan Kiszka
2010-04-20 10:51       ` Alexander Graf
2010-04-20 11:38         ` Jan Kiszka
2010-04-20 11:44           ` Alexander Graf
2010-04-21 10:04             ` Jun Koi
2010-04-21 10:11               ` Alexander Graf
2010-04-21 10:43                 ` Jan Kiszka
2010-04-21 19:20                   ` Stefan Weil
2010-04-22  7:02                     ` Jan Kiszka
2010-04-27 19:55                       ` Stefan Weil
2010-04-27 23:50                         ` Jun Koi
2010-04-28 18:06                           ` Stefan Weil
2010-04-22  7:14                     ` Jun Koi

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