qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Fix SH4 single-stepping.


From: Vladimir Prus
Subject: [Qemu-devel] [PATCH] Fix SH4 single-stepping.
Date: Sun, 12 Oct 2008 19:16:43 +0400

Presently, when connecting with GDB to sh4 system qemu emulator, single-stepping
does not work -- we end up at the same instruction. Also, after breakpoint hit,
continue does not work either -- because GDB tries to single-step over 
breakpoint,
which is likewise broken.

This patch fixes the issue.

- Volodya


        * target-sh/translate.c (gen_intermediate_code_internal): If
        singlestep is enabled, update PC before stopping.
---
 target-sh4/translate.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index 82f4168..365936f 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -1867,6 +1867,7 @@ gen_intermediate_code_internal(CPUState * env, 
TranslationBlock * tb,
     if (tb->cflags & CF_LAST_IO)
         gen_io_end();
     if (env->singlestep_enabled) {
+        tcg_gen_movi_i32(cpu_pc, ctx.pc);
         tcg_gen_helper_0_0(helper_debug);
     } else {
        switch (ctx.bstate) {
-- 
1.5.3.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]