Kernel: Send more specific signals when crashing due to CPU exceptions.

- For division by zero, send SIGFPE.
- For illegal instruction, send SIGILL.
- For the rest, default to SIGSEGV.
This commit is contained in:
Andreas Kling 2019-05-26 02:08:51 +02:00
commit 6ffcee9176
Notes: sideshowbarker 2024-07-19 13:56:37 +09:00
3 changed files with 17 additions and 9 deletions

View file

@ -720,14 +720,14 @@ void Process::sys$sigreturn()
ASSERT_NOT_REACHED();
}
void Process::crash()
void Process::crash(int signal)
{
ASSERT_INTERRUPTS_DISABLED();
ASSERT(!is_dead());
dump_backtrace();
m_termination_signal = SIGSEGV;
m_termination_signal = signal;
dump_regions();
ASSERT(is_ring3());
die();