target/sh4: Honor QEMU_LOG_FILENAME with QEMU_LOG=cpu
PATCH 1/1 target/sh4: Honor QEMU_LOG_FILENAME with QEMU_LOG=cpu
When using QEMU_LOG=cpu on sh4, QEMU_LOG_FILENAME is partially ignored. Fix by using qemu_fprintf() instead of qemu_printf() in the respective places.
Fixes 90c84c560067 ("qom/cpu: Simplify how CPUClass:cpu_dump_state() prints")
Signed-off-by Ilya Leoshkevich <[email protected]>
--- target/sh4/translate.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
target/sh4/translate.c +7 -7
@@ -171,16 +171,16 @@ void superh_cpu_dump_state(CPUState *cs, FILE *f, int flags)qemu_fprintf (f,"sgr=0x%08x dbr=0x%08x delayed_pc=0x%08x fpul=0x%08x\n" , env->sgr, env->dbr, env->delayed_pc, env->fpul);for (i =0 ; i <24 ; i +=4 ) { -qemu_printf ("r%d=0x%08x r%d=0x%08x r%d=0x%08x r%d=0x%08x\n" , - i, env->gregs[i], i +1 , env->gregs[i +1 ], - i +2 , env->gregs[i +2 ], i +3 , env->gregs[i +3 ]); +qemu_fprintf (f,"r%d=0x%08x r%d=0x%08x r%d=0x%08x r%d=0x%08x\n" , + i, env->gregs[i], i +1 , env->gregs[i +1 ], + i +2 , env->gregs[i +2 ], i +3 , env->gregs[i +3 ]); }if (env->flags &DELAY_SLOT ) { -qemu_printf ("in delay slot (delayed_pc=0x%08x)\n" , - env->delayed_pc); +qemu_fprintf (f,"in delay slot (delayed_pc=0x%08x)\n" , + env->delayed_pc); }else if (env->flags &DELAY_SLOT_CONDITIONAL ) { -qemu_printf ("in conditional delay slot (delayed_pc=0x%08x)\n" , - env->delayed_pc); +qemu_fprintf (f,"in conditional delay slot (delayed_pc=0x%08x)\n" , + env->delayed_pc); }else if (env->flags &DELAY_SLOT_RTE ) {qemu_fprintf (f,"in rte delay slot (delayed_pc=0x%08x)\n" , env->delayed_pc);
Signature · 1 line
2.35.3
Quoted 7 lines · Ilya Leoshkevich
When using QEMU_LOG=cpu on sh4,
QEMU_LOG_FILENAMEis partially ignored. Fix by usingqemu_fprintf()instead ofqemu_printf()in the respective places.Fixes 90c84c560067 ("qom/cpu: Simplify how CPUClass:cpu_dump_state() prints")Signed-off-by Ilya Leoshkevich <[email protected]>
Reviewed-by Peter Maydell <[email protected]>
Looks like sh4 was the only target where 90c84c560067 introduced this bug.
thanks
-- PMM
Quoted 42 lines · Ilya Leoshkevich
When using QEMU_LOG=cpu on sh4,
QEMU_LOG_FILENAMEis partially ignored. Fix by usingqemu_fprintf()instead ofqemu_printf()in the respective places.Fixes 90c84c560067 ("qom/cpu: Simplify how CPUClass:cpu_dump_state() prints")Signed-off-by Ilya Leoshkevich <[email protected]>--- target/sh4/translate.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)target/sh4/translate.c +7
-7@@ -171,16 +171,16 @@ void superh_cpu_dump_state(CPUState *cs, FILE *f, int flags)qemu_fprintf (f,"sgr=0x%08x dbr=0x%08x delayed_pc=0x%08x fpul=0x%08x\n" , env->sgr, env->dbr, env->delayed_pc, env->fpul);for (i =0 ; i <24 ; i +=4 ) { -qemu_printf ("r%d=0x%08x r%d=0x%08x r%d=0x%08x r%d=0x%08x\n" , - i, env->gregs[i], i +1 , env->gregs[i +1 ], - i +2 , env->gregs[i +2 ], i +3 , env->gregs[i +3 ]); +qemu_fprintf (f,"r%d=0x%08x r%d=0x%08x r%d=0x%08x r%d=0x%08x\n" , + i, env->gregs[i], i +1 , env->gregs[i +1 ], + i +2 , env->gregs[i +2 ], i +3 , env->gregs[i +3 ]); }if (env->flags &DELAY_SLOT ) { -qemu_printf ("in delay slot (delayed_pc=0x%08x)\n" , - env->delayed_pc); +qemu_fprintf (f,"in delay slot (delayed_pc=0x%08x)\n" , + env->delayed_pc); }else if (env->flags &DELAY_SLOT_CONDITIONAL ) { -qemu_printf ("in conditional delay slot (delayed_pc=0x%08x)\n" , - env->delayed_pc); +qemu_fprintf (f,"in conditional delay slot (delayed_pc=0x%08x)\n" , + env->delayed_pc); }else if (env->flags &DELAY_SLOT_RTE ) {qemu_fprintf (f,"in rte delay slot (delayed_pc=0x%08x)\n" , env->delayed_pc);Signature · 1 line
2.35.3
Reviewd-by Yoshinori Sato <[email protected]>
Signature · 1 line
Yosinori Sato