summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormalc <av1474@comtv.ru>2009-07-15 20:52:47 +0400
committermalc <av1474@comtv.ru>2009-07-15 21:03:34 +0400
commit430c7ec700bf508efadd539480f0ecaf24ca1d2c (patch)
treee0ab08732fbc812dce9368ba7a768ff56e8162f7
parentf64ab228b8464246fad7fdb5669911513b9a695d (diff)
downloadqemu-430c7ec700bf508efadd539480f0ecaf24ca1d2c.tar.gz
qemu-430c7ec700bf508efadd539480f0ecaf24ca1d2c.tar.bz2
qemu-430c7ec700bf508efadd539480f0ecaf24ca1d2c.zip
Avoid SIGSEGV when dumping cpu state without enabled logging
Signed-off-by: malc <av1474@comtv.ru>
-rw-r--r--linux-user/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index e331d658fb..1e95f02124 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -1053,7 +1053,8 @@ do { \
fprintf(stderr, fmt , ## __VA_ARGS__); \
cpu_dump_state(env, stderr, fprintf, 0); \
qemu_log(fmt, ## __VA_ARGS__); \
- log_cpu_state(env, 0); \
+ if (logfile) \
+ log_cpu_state(env, 0); \
} while (0)
void cpu_loop(CPUPPCState *env)