The m68k gdbstub SR reg request doesnt include Condition-Codes
PATCH v3 1/1 The m68k gdbstub SR reg request doesnt include Condition-Codes
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.
---
Notes:
v1->v2
- removed my superfluous braces
- slightly amended the commit message
v2->v3
- removed my incorrect use of code block in a switch
target/m68k/gdbstub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
target/m68k/gdbstub.c +2 -1
@@ -36,7 +36,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); }
Signature · 1 line
2.21.0
Le 09/06/2019 à 12:51, Lucien Murray-Pitts a écrit :
Quoted 27 lines
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_registerfor SR register.Signed-off-by Lucien Murray-Pitts <[email protected]>---
Notes:
v1->v2
- removed my superfluous braces
- slightly amended the commit message
v2->v3
- removed my incorrect use of code block in a switchtarget/m68k/gdbstub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)target/m68k/gdbstub.c +0
-0
target/m68k/gdbstub.c int m68k_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n) · line 43
Quoted 9 lines
target/m68k/gdbstub.c +2
-1@@ -36,7 +36,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); }