1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

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
parent 0fa098845f
commit 6ffcee9176
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();