* [Qemu-devel] [PATCH v2] The m68k gdbstub SR reg request doesnt include Condition-Codes
@ 2019-06-09 9:07 Lucien Murray-Pitts
2019-06-09 10:13 ` Laurent Vivier
0 siblings, 1 reply; 2+ messages in thread
From: Lucien Murray-Pitts @ 2019-06-09 9:07 UTC (permalink / raw)
To: qemu-devel, Laurent Vivier, Lucien Murray-Pitts
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>
---
Notes:
v1->v2
- remove superfluous braces from my additional code
- slightly amended the commit message
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..5e5aef5c0f 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);
}
--
2.21.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] The m68k gdbstub SR reg request doesnt include Condition-Codes
2019-06-09 9:07 [Qemu-devel] [PATCH v2] The m68k gdbstub SR reg request doesnt include Condition-Codes Lucien Murray-Pitts
@ 2019-06-09 10:13 ` Laurent Vivier
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Vivier @ 2019-06-09 10:13 UTC (permalink / raw)
To: Lucien Murray-Pitts, qemu-devel
Le 09/06/2019 à 11:07, Lucien Murray-Pitts a écrit :
> 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>
> ---
>
> Notes:
> v1->v2
> - remove superfluous braces from my additional code
You removed the parentheses.
> - slightly amended the commit message
>
> 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..5e5aef5c0f 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: {
You can also remove the braces.
> + /* 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);
> }
>
Thanks,
Laurent
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-09 10:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-09 9:07 [Qemu-devel] [PATCH v2] The m68k gdbstub SR reg request doesnt include Condition-Codes Lucien Murray-Pitts
2019-06-09 10:13 ` Laurent Vivier
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.