qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] cpu-exec: make TBs generated codes unlinked whe


From: Laurent Desnogues
Subject: Re: [Qemu-devel] [PATCH] cpu-exec: make TBs generated codes unlinked when -singlestep
Date: Fri, 25 Jul 2014 14:07:51 +0200

Hello,

On Fri, Jul 25, 2014 at 6:37 AM, Jincheng Miao <address@hidden> wrote:
> '-singlestep' option will make TB contains only one instruction,
> so that the qemu_log could output trace log when CPU_LOG_EXEC sets,
> and it could help developers to debug control flow.
>
> But currently, in cpu_exec(), it doesn't check singlestep when
> tb_add_jump(), so the TB linked is executed siliently.
> Therefore, this patch adds singlestep check before tb_add_jump().
>
> Signed-off-by: Jincheng Miao <address@hidden>

I tested your patch in an environment generating run time traces
and it works fine.

Tested-by: Laurent Desnogues <address@hidden>

Thanks,

Laurent

> ---
>  cpu-exec.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/cpu-exec.c b/cpu-exec.c
> index 38e5f02..64b7289 100644
> --- a/cpu-exec.c
> +++ b/cpu-exec.c
> @@ -622,8 +622,8 @@ int cpu_exec(CPUArchState *env)
>                  }
>                  /* see if we can patch the calling TB. When the TB
>                     spans two pages, we cannot safely do a direct
> -                   jump. */
> -                if (next_tb != 0 && tb->page_addr[1] == -1) {
> +                   jump. So as when singlestep is enabled. */
> +                if (next_tb != 0 && tb->page_addr[1] == -1 && !singlestep) {
>                      tb_add_jump((TranslationBlock *)(next_tb & 
> ~TB_EXIT_MASK),
>                                  next_tb & TB_EXIT_MASK, tb);
>                  }
> --
> 1.7.1
>
>



reply via email to

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