x86/tools: Fix insn_sanity message outputs
Fix x86 instruction decoder test to dump all error messages to stderr and others to stdout. Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: yrl.pp-manager.tt@hitachi.com Link: http://lkml.kernel.org/r/20111205120550.15475.70149.stgit@cloud Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
bfbe9015de
commit
e70825fc51
@ -102,7 +102,7 @@ static void dump_stream(FILE *fp, const char *msg, unsigned long nr_iter,
|
|||||||
|
|
||||||
fprintf(fp, "%s:\n", msg);
|
fprintf(fp, "%s:\n", msg);
|
||||||
|
|
||||||
dump_insn(stderr, insn);
|
dump_insn(fp, insn);
|
||||||
|
|
||||||
fprintf(fp, "You can reproduce this with below command(s);\n");
|
fprintf(fp, "You can reproduce this with below command(s);\n");
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ int main(int argc, char **argv)
|
|||||||
if (insn.next_byte <= insn.kaddr ||
|
if (insn.next_byte <= insn.kaddr ||
|
||||||
insn.kaddr + MAX_INSN_SIZE < insn.next_byte) {
|
insn.kaddr + MAX_INSN_SIZE < insn.next_byte) {
|
||||||
/* Access out-of-range memory */
|
/* Access out-of-range memory */
|
||||||
dump_stream(stdout, "Error: Found an access violation", i, insn_buf, &insn);
|
dump_stream(stderr, "Error: Found an access violation", i, insn_buf, &insn);
|
||||||
errors++;
|
errors++;
|
||||||
} else if (verbose && !insn_complete(&insn))
|
} else if (verbose && !insn_complete(&insn))
|
||||||
dump_stream(stdout, "Info: Found an undecodable input", i, insn_buf, &insn);
|
dump_stream(stdout, "Info: Found an undecodable input", i, insn_buf, &insn);
|
||||||
|
Reference in New Issue
Block a user