Received: from eggs.gnu.org ([140.186.70.92]:46588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROu6Q-0002x3-2U for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:37:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROu6O-0007hg-Ne for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:37:17 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41278 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROu6O-0007hT-He for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:37:16 -0500 From: Alexander Graf Date: Fri, 11 Nov 2011 17:37:28 +0100 Message-Id: <1321029448-11010-4-git-send-email-agraf@suse.de> In-Reply-To: <1321029448-11010-1-git-send-email-agraf@suse.de> References: <1321029448-11010-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 3/3] PPC: Fix for the gdb single step problem on an rfi instruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Developers Cc: blauwirbel@gmail.com, Sebastian Bauer From: Sebastian Bauer When using gdb to single step a ppc interrupt routine, the execution flow passes the rfi instruction without actually returning from the interrupt. The patch fixes this by avoiding to update the nip when the debug exception is raised and a previous POWERPC_EXCP_SYNC was set. The latter is the case only, if code for rfi or a related instruction was generated. Signed-off-by: Sebastian Bauer Signed-off-by: Alexander Graf --- target-ppc/translate.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 99e995c..66eae30 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -298,8 +298,10 @@ static inline void gen_debug_exception(DisasContext *ctx) { TCGv_i32 t0; - if (ctx->exception != POWERPC_EXCP_BRANCH) + if ((ctx->exception != POWERPC_EXCP_BRANCH) && + (ctx->exception != POWERPC_EXCP_SYNC)) { gen_update_nip(ctx, ctx->nip); + } t0 = tcg_const_i32(EXCP_DEBUG); gen_helper_raise_exception(t0); tcg_temp_free_i32(t0); -- 1.6.0.2