Patchwork Re: Missing singlestep for already-translated code?

login
register
mail settings
Submitter takasi-y@ops.dti.ne.jp
Date April 13, 2010, 9:21 a.m.
Message ID <20100413182130.e8ae2da6.takasi-y@ops.dti.ne.jp>
Download mbox | patch
Permalink /patch/50052/
State New
Headers show

Comments

takasi-y@ops.dti.ne.jp - April 13, 2010, 9:21 a.m.
Hi,
> So for the already-translated code, we will miss singlestep?
At least SH4(and mips?) shows such behaviour.
I think a patch below enables single stepping in such case, too.
But, I'm not sure if this behaviour is on purpose, nor this patch is correct.
/yoshii
Jun Koi - April 13, 2010, 9:48 a.m.
On Tue, Apr 13, 2010 at 6:21 PM,  <takasi-y@ops.dti.ne.jp> wrote:
> Hi,
>> So for the already-translated code, we will miss singlestep?
> At least SH4(and mips?) shows such behaviour.
> I think a patch below enables single stepping in such case, too.
> But, I'm not sure if this behaviour is on purpose, nor this patch is correct.
> /yoshii
>
> diff --git a/target-sh4/translate.c b/target-sh4/translate.c
> index 3537f8c..dfa724a 100644
> --- a/target-sh4/translate.c
> +++ b/target-sh4/translate.c
> @@ -300,7 +300,7 @@ static void gen_goto_tb(DisasContext * ctx, int n, target_ulong dest)
>     tb = ctx->tb;
>
>     if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) &&
> -       !ctx->singlestep_enabled) {
> +       !ctx->singlestep_enabled && !singlestep) {
>        /* Use a direct jump if in same page and singlestep not enabled */
>         tcg_gen_goto_tb(n);
>         tcg_gen_movi_i32(cpu_pc, dest);
>

The first glance: because you are patching translate.c, I dont think
you fixed the problem.

Thanks,
J

Patch

diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index 3537f8c..dfa724a 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -300,7 +300,7 @@  static void gen_goto_tb(DisasContext * ctx, int n, target_ulong dest)
     tb = ctx->tb;
 
     if ((tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) &&
-	!ctx->singlestep_enabled) {
+	!ctx->singlestep_enabled && !singlestep) {
 	/* Use a direct jump if in same page and singlestep not enabled */
         tcg_gen_goto_tb(n);
         tcg_gen_movi_i32(cpu_pc, dest);