Skip to content
Snippets Groups Projects
Commit 21a474c4 authored by Richard Henderson's avatar Richard Henderson
Browse files

linux-user/sparc: Raise SIGILL for all unhandled software traps


The linux kernel's trap tables vector all unassigned trap
numbers to BAD_TRAP, which then raises SIGILL.

Tested-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Reported-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
parent 2627e452
No related branches found
No related tags found
No related merge requests found
......@@ -248,6 +248,14 @@ void cpu_loop (CPUSPARCState *env)
cpu_exec_step_atomic(cs);
break;
default:
/*
* Most software trap numbers vector to BAD_TRAP.
* Handle anything not explicitly matched above.
*/
if (trapnr >= TT_TRAP && trapnr <= TT_TRAP + 0x7f) {
force_sig_fault(TARGET_SIGILL, ILL_ILLTRP, env->pc);
break;
}
fprintf(stderr, "Unhandled trap: 0x%x\n", trapnr);
cpu_dump_state(cs, stderr, 0);
exit(EXIT_FAILURE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment