From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: "Riku Voipio" <riku.voipio@iki.fi>,
"Laurent Vivier" <laurent@vivier.eu>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [Qemu-devel] [PULL 3/3] linux-user: Report error message on stderr, rather than stdout
Date: Tue, 10 Jul 2018 08:23:52 +0200 [thread overview]
Message-ID: <20180710062352.9843-4-laurent@vivier.eu> (raw)
In-Reply-To: <20180710062352.9843-1-laurent@vivier.eu>
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Code change produced with:
git ls-files linux-user | \
xargs sed -i -E 's/(\s+)printf\s*\(("Unhandled.*)\);/\1fprintf(stderr, \2);/g'
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20180706155127.7483-4-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/alpha/cpu_loop.c | 2 +-
linux-user/cris/cpu_loop.c | 2 +-
linux-user/microblaze/cpu_loop.c | 6 +++---
linux-user/sh4/cpu_loop.c | 2 +-
linux-user/sparc/cpu_loop.c | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/linux-user/alpha/cpu_loop.c b/linux-user/alpha/cpu_loop.c
index b87fcaea87..c1a98c8cbf 100644
--- a/linux-user/alpha/cpu_loop.c
+++ b/linux-user/alpha/cpu_loop.c
@@ -196,7 +196,7 @@ void cpu_loop(CPUAlphaState *env)
arch_interrupt = false;
break;
default:
- printf ("Unhandled trap: 0x%x\n", trapnr);
+ fprintf(stderr, "Unhandled trap: 0x%x\n", trapnr);
cpu_dump_state(cs, stderr, fprintf, 0);
exit(EXIT_FAILURE);
}
diff --git a/linux-user/cris/cpu_loop.c b/linux-user/cris/cpu_loop.c
index 1c5eca9f83..37bdcfa8cc 100644
--- a/linux-user/cris/cpu_loop.c
+++ b/linux-user/cris/cpu_loop.c
@@ -81,7 +81,7 @@ void cpu_loop(CPUCRISState *env)
cpu_exec_step_atomic(cs);
break;
default:
- printf ("Unhandled trap: 0x%x\n", trapnr);
+ fprintf(stderr, "Unhandled trap: 0x%x\n", trapnr);
cpu_dump_state(cs, stderr, fprintf, 0);
exit(EXIT_FAILURE);
}
diff --git a/linux-user/microblaze/cpu_loop.c b/linux-user/microblaze/cpu_loop.c
index 5af12d5b21..2af93eb39a 100644
--- a/linux-user/microblaze/cpu_loop.c
+++ b/linux-user/microblaze/cpu_loop.c
@@ -105,8 +105,8 @@ void cpu_loop(CPUMBState *env)
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
break;
default:
- printf("Unhandled hw-exception: 0x%" PRIx64 "\n",
- env->sregs[SR_ESR] & ESR_EC_MASK);
+ fprintf(stderr, "Unhandled hw-exception: 0x%" PRIx64 "\n",
+ env->sregs[SR_ESR] & ESR_EC_MASK);
cpu_dump_state(cs, stderr, fprintf, 0);
exit(EXIT_FAILURE);
break;
@@ -130,7 +130,7 @@ void cpu_loop(CPUMBState *env)
cpu_exec_step_atomic(cs);
break;
default:
- printf ("Unhandled trap: 0x%x\n", trapnr);
+ fprintf(stderr, "Unhandled trap: 0x%x\n", trapnr);
cpu_dump_state(cs, stderr, fprintf, 0);
exit(EXIT_FAILURE);
}
diff --git a/linux-user/sh4/cpu_loop.c b/linux-user/sh4/cpu_loop.c
index 418833ea25..fdd348170b 100644
--- a/linux-user/sh4/cpu_loop.c
+++ b/linux-user/sh4/cpu_loop.c
@@ -84,7 +84,7 @@ void cpu_loop(CPUSH4State *env)
arch_interrupt = false;
break;
default:
- printf ("Unhandled trap: 0x%x\n", trapnr);
+ fprintf(stderr, "Unhandled trap: 0x%x\n", trapnr);
cpu_dump_state(cs, stderr, fprintf, 0);
exit(EXIT_FAILURE);
}
diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c
index 7c4796ca23..91f714afc6 100644
--- a/linux-user/sparc/cpu_loop.c
+++ b/linux-user/sparc/cpu_loop.c
@@ -285,7 +285,7 @@ void cpu_loop (CPUSPARCState *env)
cpu_exec_step_atomic(cs);
break;
default:
- printf ("Unhandled trap: 0x%x\n", trapnr);
+ fprintf(stderr, "Unhandled trap: 0x%x\n", trapnr);
cpu_dump_state(cs, stderr, fprintf, 0);
exit(EXIT_FAILURE);
}
--
2.17.1
next prev parent reply other threads:[~2018-07-10 6:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 6:23 [Qemu-devel] [PULL 0/3] Linux user for 3.0 patches Laurent Vivier
2018-07-10 6:23 ` [Qemu-devel] [PULL 1/3] linux-user: Do not report "Unsupported syscall" by default Laurent Vivier
2018-07-10 6:23 ` [Qemu-devel] [PULL 2/3] linux-user: Do not report "syscall not implemented" " Laurent Vivier
2018-07-10 6:23 ` Laurent Vivier [this message]
2018-07-10 9:51 ` [Qemu-devel] [PULL 0/3] Linux user for 3.0 patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180710062352.9843-4-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=f4bug@amsat.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).