From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAXI1-0005Jt-5d for qemu-devel@nongnu.org; Fri, 25 Jul 2014 00:39:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XAXHv-00005V-1E for qemu-devel@nongnu.org; Fri, 25 Jul 2014 00:39:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XAXHu-00005R-Q0 for qemu-devel@nongnu.org; Fri, 25 Jul 2014 00:39:22 -0400 From: Jincheng Miao Date: Fri, 25 Jul 2014 12:37:53 +0800 Message-Id: <1406263073-635-1-git-send-email-jmiao@redhat.com> Subject: [Qemu-devel] [PATCH] cpu-exec: make TBs generated codes unlinked when -singlestep List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: riku.voipio@iki.fi, Jincheng Miao , rth@twiddle.net '-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 --- 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