diff mbox series

The m68k gdbstub SR reg request doesnt include Condition-Codes

Message ID 20190526074527.33632-1-lucienmp_antispam@yahoo.com (mailing list archive)
State New, archived
Headers show
Series The m68k gdbstub SR reg request doesnt include Condition-Codes | expand

Commit Message

Zhijian Li (Fujitsu)" via May 26, 2019, 7:45 a.m. UTC
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 <lucienmp_antispam@yahoo.com>
---
 target/m68k/gdbstub.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

no-reply@patchew.org May 26, 2019, 9:10 a.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20190526074527.33632-1-lucienmp_antispam@yahoo.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [Qemu-devel] [PATCH] The m68k gdbstub SR reg request doesnt include Condition-Codes
Message-id: 20190526074527.33632-1-lucienmp_antispam@yahoo.com
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
d12cb52 The m68k gdbstub SR reg request doesnt include Condition-Codes

=== OUTPUT BEGIN ===
ERROR: Author email address is mangled by the mailing list
#2: 
Author: Lucien Murray-Pitts via Qemu-devel <qemu-devel@nongnu.org>

total: 1 errors, 0 warnings, 12 lines checked

Commit d12cb52d6c7f (The m68k gdbstub SR reg request doesnt include Condition-Codes) has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190526074527.33632-1-lucienmp_antispam@yahoo.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Laurent Vivier May 26, 2019, 12:53 p.m. UTC | #2
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 <lucienmp_antispam@yahoo.com>
> ---
>   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 <laurent@vivier.eu>

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

Patch

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)));
+        }
         case 17:
             return gdb_get_reg32(mem_buf, env->pc);
         }