mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
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: Ilya Leoshkevich <iii@linux.ibm.com> Reported-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
2627e4524e
commit
21a474c41d
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue