All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Sebastian Bauer <mail@sebastianbauer.info>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] PPC: Fix for the gdb single step problem on an rfi instruction
Date: Thu, 10 Nov 2011 18:11:38 +0100	[thread overview]
Message-ID: <4EBC05CA.1080907@suse.de> (raw)
In-Reply-To: <1dff061de511be8246b1e86a63cbf4a8@sebastianbauer.info>

On 08/10/2011 01:41 PM, Sebastian Bauer wrote:
> 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 <mail@sebastianbauer.info>
> ---
> diff --git a/target-ppc/translate.c b/target-ppc/translate.c
> index fd7c208..42b91fd 100644
> --- a/target-ppc/translate.c
> +++ b/target-ppc/translate.c
> @@ -287,7 +287,7 @@ 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);

I fixed the patch up to align with the coding style rules:


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);


Otherwise, applied to ppc-next now. Thanks a lot! And sorry for the late 
reply again. Please send your next patch CC'ed to qemu-ppc@nongnu.org - 
that makes it a lot easier for to not lose track of it :).


Alex

      parent reply	other threads:[~2011-11-10 17:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-10 11:41 [Qemu-devel] [PATCH] PPC: Fix for the gdb single step problem on an rfi instruction Sebastian Bauer
2011-08-12 13:29 ` Elie Richa
2011-09-14 10:57   ` Sebastian Bauer
2011-11-10 17:11 ` Alexander Graf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EBC05CA.1080907@suse.de \
    --to=agraf@suse.de \
    --cc=mail@sebastianbauer.info \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.