qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Riku Voipio <riku.voipio@iki.fi>,
	Laurent Vivier <laurent@vivier.eu>,
	Lucien Murray-Pitts <lucienmp.qemu@gmail.com>
Subject: [Qemu-devel] [PULL 1/3] The m68k gdbstub SR reg request doesnt include Condition-Codes
Date: Wed, 26 Jun 2019 18:20:58 +0200	[thread overview]
Message-ID: <20190626162100.24774-2-laurent@vivier.eu> (raw)
In-Reply-To: <20190626162100.24774-1-laurent@vivier.eu>

From: Lucien Murray-Pitts <lucienmp.qemu@gmail.com>

The register request via gdbstub would return the SR part
which contains the Trace/Master/IRQ state flags, but
would be missing the CR (Condition Register) state bits.

This fix adds this support by merging them in the m68k
specific gdbstub handler m68k_cpu_gdb_read_register for SR register.

Signed-off-by: Lucien Murray-Pitts <lucienmp.qemu@gmail.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20190609105154.GA16755@localhost.localdomain>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target/m68k/gdbstub.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/m68k/gdbstub.c b/target/m68k/gdbstub.c
index e6baf0601e..5cad2b658f 100644
--- a/target/m68k/gdbstub.c
+++ b/target/m68k/gdbstub.c
@@ -35,7 +35,8 @@ int m68k_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
     } else {
         switch (n) {
         case 16:
-            return gdb_get_reg32(mem_buf, env->sr);
+            /* SR is made of SR+CCR, CCR is many 1bit flags so uses helper */
+            return gdb_get_reg32(mem_buf, env->sr | cpu_m68k_get_ccr(env));
         case 17:
             return gdb_get_reg32(mem_buf, env->pc);
         }
-- 
2.21.0



  reply	other threads:[~2019-06-26 16:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26 16:20 [Qemu-devel] [PULL 0/3] M68k next patches Laurent Vivier
2019-06-26 16:20 ` Laurent Vivier [this message]
2019-06-26 16:20 ` [Qemu-devel] [PULL 2/3] m68k comments break patch submission due to being incorrectly formatted Laurent Vivier
2019-06-26 16:21 ` [Qemu-devel] [PULL 3/3] linux-user/m68k: remove simulator syscall interface Laurent Vivier
2019-06-26 16:52 ` [Qemu-devel] [PULL 0/3] M68k next patches no-reply
2019-07-01 16:40 ` Peter Maydell

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=20190626162100.24774-2-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=lucienmp.qemu@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /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).