target/riscv: Dump CSR mscratch/sscratch/satp
PATCH 1/1 target/riscv: Dump CSR mscratch/sscratch/satp
This dumps the CSR mscratch/sscratch/satp and meanwhile aligns the output of CSR mtval/stval.
Signed-off-by Changbin Du <[email protected]>
--- target/riscv/cpu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
target/riscv/cpu.c +5 -2
@@ -281,12 +281,15 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)if (riscv_has_ext (env,RVH )) {qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"vscause " , env->vscause); } -qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mtval " , env->mtval); -qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"stval " , env->sbadaddr); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mtval " , env->mtval); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"stval " , env->sbadaddr);if (riscv_has_ext (env,RVH )) {qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"htval " , env->htval);qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mtval2 " , env->mtval2); } +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mscratch" , env->mscratch); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"sscratch" , env->sscratch); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"satp " , env->satp);#endif for (i =0 ; i <32 ; i++) {
Signature · 1 line
2.27.0
Quoted 5 lines · Changbin Du
This dumps the CSR mscratch/sscratch/satp and meanwhile aligns the output of CSR mtval/stval.
Signed-off-by Changbin Du <[email protected]>
Reviewed-by Alistair Francis <[email protected]>
Alistair
Quoted 30 lines
--- target/riscv/cpu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)target/riscv/cpu.c +5
-3@@ -281,12 +281,15 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)if (riscv_has_ext (env,RVH )) {qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"vscause " , env->vscause); } -qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mtval " , env->mtval); -qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"stval " , env->sbadaddr); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mtval " , env->mtval); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"stval " , env->sbadaddr);if (riscv_has_ext (env,RVH )) {qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"htval " , env->htval);qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mtval2 " , env->mtval2); } +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mscratch" , env->mscratch); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"sscratch" , env->sscratch); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"satp " , env->satp);#endif for (i =0 ; i <32 ; i++) { --2.27.0
Quoted 14 lines · Changbin Du
This dumps the CSR mscratch/sscratch/satp and meanwhile aligns the output of CSR mtval/stval.
Signed-off-by Changbin Du <[email protected]>--- target/riscv/cpu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)target/riscv/cpu.c +0
-0
target/riscv/cpu.c static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags) · line 288
Quoted 10 lines
target/riscv/cpu.c +2
-2@@ -281,12 +281,15 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags)if (riscv_has_ext (env,RVH )) {qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"vscause " , env->vscause); } -qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mtval " , env->mtval); -qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"stval " , env->sbadaddr); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mtval " , env->mtval); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"stval " , env->sbadaddr);if (riscv_has_ext (env,RVH )) {qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"htval " , env->htval);qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mtval2 " , env->mtval2);
I believe you also need some alignment for these 2
target/riscv/cpu.c static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags) · line 295
Quoted 7 lines
target/riscv/cpu.c +3
-0} +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"mscratch" , env->mscratch); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"sscratch" , env->sscratch); +qemu_fprintf (f," %s " TARGET_FMT_lx"\n" ,"satp " , env->satp);#endif for (i =0 ; i <32 ; i++) {
Reviewed-by Bin Meng <[email protected]>