From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kp2gd-0000yH-SQ for qemu-devel@nongnu.org; Sun, 12 Oct 2008 11:16:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kp2gc-0000y4-DJ for qemu-devel@nongnu.org; Sun, 12 Oct 2008 11:16:51 -0400 Received: from [199.232.76.173] (port=55691 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kp2gc-0000y1-Ab for qemu-devel@nongnu.org; Sun, 12 Oct 2008 11:16:50 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:60220) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kp2gb-0001f7-UY for qemu-devel@nongnu.org; Sun, 12 Oct 2008 11:16:50 -0400 From: Vladimir Prus Date: Sun, 12 Oct 2008 19:16:43 +0400 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810121916.43846.vladimir@codesourcery.com> Subject: [Qemu-devel] [PATCH] Fix SH4 single-stepping. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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