提交 632314c4 编写于 作者: P Peter Maydell 提交者: Blue Swirl

qemu-log: Remove qemu_log_try_set_file() and its users

Remove the function qemu_log_try_set_file() and its users (which
are all in TCG code generation functions for various targets).
This function was added to abstract out code which was originally
written as "if (!logfile) logfile = stderr;" in order that BUG:
case code which did an unguarded "fprintf(logfile, ...)" would
not crash if debug logging was not enabled. Since those direct
uses of logfile have also been abstracted away into qemu_log()
calls which check for a NULL logfile, there is no need for the
target-* files to mess with the user's chosen logging settings.
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NAndreas Färber <afaerber@suse.de>
Acked-by: NMichael Walle <michael@walle.cc>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 685cbd2f
......@@ -126,14 +126,6 @@ static inline void qemu_log_set_file(FILE *f)
qemu_logfile = f;
}
/* Set up a new log file, only if none is set */
static inline void qemu_log_try_set_file(FILE *f)
{
if (!qemu_logfile) {
qemu_logfile = f;
}
}
/* define log items */
typedef struct QEMULogItem {
int mask;
......
......@@ -3215,8 +3215,6 @@ gen_intermediate_code_internal(CPUCRISState *env, TranslationBlock *tb,
int num_insns;
int max_insns;
qemu_log_try_set_file(stderr);
if (env->pregs[PR_VR] == 32) {
dc->decoder = crisv32_decoder;
dc->clear_locked_irq = 0;
......
......@@ -1012,8 +1012,6 @@ static void gen_intermediate_code_internal(CPULM32State *env,
int num_insns;
int max_insns;
qemu_log_try_set_file(stderr);
pc_start = tb->pc;
dc->env = env;
dc->tb = tb;
......
......@@ -1734,8 +1734,6 @@ gen_intermediate_code_internal(CPUMBState *env, TranslationBlock *tb,
int num_insns;
int max_insns;
qemu_log_try_set_file(stderr);
pc_start = tb->pc;
dc->env = env;
dc->tb = tb;
......
......@@ -1670,8 +1670,6 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu,
int num_insns;
int max_insns;
qemu_log_try_set_file(stderr);
pc_start = tb->pc;
dc->tb = tb;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册