qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] The m68k gdbstub SR reg request doesnt include


From: Laurent Vivier
Subject: Re: [Qemu-devel] [PATCH] The m68k gdbstub SR reg request doesnt include Condition-Codes
Date: Sun, 26 May 2019 14:53:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 26/05/2019 09:45, Lucien Murray-Pitts wrote:
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

Signed-off-by: Lucien Murray-Pitts <address@hidden>
---
  target/m68k/gdbstub.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/m68k/gdbstub.c b/target/m68k/gdbstub.c
index fd2bb46c42..f092044883 100644
--- a/target/m68k/gdbstub.c
+++ b/target/m68k/gdbstub.c
@@ -35,8 +35,10 @@ int m68k_cpu_gdb_read_register(CPUState *cs, uint8_t 
*mem_buf, int n)
          return gdb_get_reg32(mem_buf, env->aregs[n - 8]);
      } else {
          switch (n) {
-        case 16:
-            return gdb_get_reg32(mem_buf, env->sr);
+        case 16: {
+            /* 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)));

I think parenthesis are superfluous.

With that fixed:

Reviewed-by: Laurent Vivier <address@hidden>

+        }
          case 17:
              return gdb_get_reg32(mem_buf, env->pc);
          }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]