qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Christoffer Dall <c.dall@virtualopensystems.com>,
	Alexander Graf <agraf@suse.de>,
	patches@linaro.org
Subject: [Qemu-devel] [PATCH] gdbstub: Synchronize CPU state unconditionally in gdb_set_cpu_pc
Date: Mon, 12 Mar 2012 16:24:45 +0000	[thread overview]
Message-ID: <1331569485-3559-1-git-send-email-peter.maydell@linaro.org> (raw)

Synchronize the CPU state via cpu_sychronize_state() unconditionally
in gdb_set_cpu_pc() rather than only in some of the target ifdef
ladder cases.

We can divide the CPUs into three categories:
 * non-KVM targets: no change of behaviour since we will use the
   kvm-stub.c no-op function.
 * i386 and s390: no change of behaviour since they were already
   calling this function
 * PPC (in KVM mode): this fixes an error: failing to synchronise
   was accidental and probably a bug.

This also paves the way for other targets (specifically ARM) which
can add KVM support in future without having to add another target
specific change to this bit of code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Alex: could you test the KVM PPC case, please, since that's the only
one where we actually change behaviour here?

 gdbstub.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/gdbstub.c b/gdbstub.c
index ef95ac2..776dcc5 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1904,8 +1904,8 @@ static void gdb_breakpoint_remove_all(void)
 
 static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
 {
-#if defined(TARGET_I386)
     cpu_synchronize_state(s->c_cpu);
+#if defined(TARGET_I386)
     s->c_cpu->eip = pc;
 #elif defined (TARGET_PPC)
     s->c_cpu->nip = pc;
@@ -1930,7 +1930,6 @@ static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
 #elif defined (TARGET_ALPHA)
     s->c_cpu->pc = pc;
 #elif defined (TARGET_S390X)
-    cpu_synchronize_state(s->c_cpu);
     s->c_cpu->psw.addr = pc;
 #elif defined (TARGET_LM32)
     s->c_cpu->pc = pc;
-- 
1.7.1

             reply	other threads:[~2012-03-12 16:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12 16:24 Peter Maydell [this message]
2012-04-03 11:57 ` [Qemu-devel] [PATCH] gdbstub: Synchronize CPU state unconditionally in gdb_set_cpu_pc Peter Maydell
2012-04-03 14:58   ` Christoffer Dall

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=1331569485-3559-1-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=agraf@suse.de \
    --cc=c.dall@virtualopensystems.com \
    --cc=patches@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).