Commit 430c7ec700bf508efadd539480f0ecaf24ca1d2c
1 parent
f64ab228
Avoid SIGSEGV when dumping cpu state without enabled logging
Signed-off-by: malc <av1474@comtv.ru>
Showing
1 changed file
with
2 additions
and
1 deletions
linux-user/main.c
@@ -1053,7 +1053,8 @@ do { \ | @@ -1053,7 +1053,8 @@ do { \ | ||
1053 | fprintf(stderr, fmt , ## __VA_ARGS__); \ | 1053 | fprintf(stderr, fmt , ## __VA_ARGS__); \ |
1054 | cpu_dump_state(env, stderr, fprintf, 0); \ | 1054 | cpu_dump_state(env, stderr, fprintf, 0); \ |
1055 | qemu_log(fmt, ## __VA_ARGS__); \ | 1055 | qemu_log(fmt, ## __VA_ARGS__); \ |
1056 | - log_cpu_state(env, 0); \ | 1056 | + if (logfile) \ |
1057 | + log_cpu_state(env, 0); \ | ||
1057 | } while (0) | 1058 | } while (0) |
1058 | 1059 | ||
1059 | void cpu_loop(CPUPPCState *env) | 1060 | void cpu_loop(CPUPPCState *env) |