* [PATCH] target/sh4: Honor QEMU_LOG_FILENAME with QEMU_LOG=cpu
@ 2022-07-25 14:28 Ilya Leoshkevich
2022-07-25 14:43 ` Peter Maydell
2022-07-27 2:09 ` Yoshinori Sato
0 siblings, 2 replies; 3+ messages in thread
From: Ilya Leoshkevich @ 2022-07-25 14:28 UTC (permalink / raw)
To: Yoshinori Sato
Cc: qemu-devel, Markus Armbruster, Christian Borntraeger,
Ilya Leoshkevich
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 <iii@linux.ibm.com>
---
target/sh4/translate.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/target/sh4/translate.c b/target/sh4/translate.c
index f1b190e7cf..9aadaf52cd 100644
--- a/target/sh4/translate.c
+++ b/target/sh4/translate.c
@@ -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);
--
2.35.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] target/sh4: Honor QEMU_LOG_FILENAME with QEMU_LOG=cpu
2022-07-25 14:28 [PATCH] target/sh4: Honor QEMU_LOG_FILENAME with QEMU_LOG=cpu Ilya Leoshkevich
@ 2022-07-25 14:43 ` Peter Maydell
2022-07-27 2:09 ` Yoshinori Sato
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2022-07-25 14:43 UTC (permalink / raw)
To: Ilya Leoshkevich
Cc: Yoshinori Sato, qemu-devel, Markus Armbruster,
Christian Borntraeger
On Mon, 25 Jul 2022 at 15:32, Ilya Leoshkevich <iii@linux.ibm.com> wrote:
>
> 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 <iii@linux.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Looks like sh4 was the only target where 90c84c560067 introduced this bug.
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] target/sh4: Honor QEMU_LOG_FILENAME with QEMU_LOG=cpu
2022-07-25 14:28 [PATCH] target/sh4: Honor QEMU_LOG_FILENAME with QEMU_LOG=cpu Ilya Leoshkevich
2022-07-25 14:43 ` Peter Maydell
@ 2022-07-27 2:09 ` Yoshinori Sato
1 sibling, 0 replies; 3+ messages in thread
From: Yoshinori Sato @ 2022-07-27 2:09 UTC (permalink / raw)
To: Ilya Leoshkevich; +Cc: qemu-devel, Markus Armbruster, Christian Borntraeger
On Mon, 25 Jul 2022 23:28:54 +0900,
Ilya Leoshkevich wrote:
>
> 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 <iii@linux.ibm.com>
> ---
> target/sh4/translate.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/target/sh4/translate.c b/target/sh4/translate.c
> index f1b190e7cf..9aadaf52cd 100644
> --- a/target/sh4/translate.c
> +++ b/target/sh4/translate.c
> @@ -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);
> --
> 2.35.3
>
Reviewd-by: Yoshinori Sato <ysato@users.sourceforge.jp>
--
Yosinori Sato
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-27 2:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-25 14:28 [PATCH] target/sh4: Honor QEMU_LOG_FILENAME with QEMU_LOG=cpu Ilya Leoshkevich
2022-07-25 14:43 ` Peter Maydell
2022-07-27 2:09 ` Yoshinori Sato
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.