mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 18:57:42 +00:00
Kernel: Symbolicate the crash address too, not just the call stack.
Also print it in shiny red to make it extra easy to spot. :^) Fixes #244.
This commit is contained in:
parent
c5d623e048
commit
15bea7153a
3 changed files with 11 additions and 7 deletions
|
@ -171,14 +171,14 @@ void exception_6_handler(RegisterDump& regs)
|
||||||
current->pid());
|
current->pid());
|
||||||
|
|
||||||
dump(regs);
|
dump(regs);
|
||||||
dump_backtrace();
|
|
||||||
|
|
||||||
if (current->process().is_ring0()) {
|
if (current->process().is_ring0()) {
|
||||||
kprintf("Oh shit, we've crashed in ring 0 :(\n");
|
kprintf("Oh shit, we've crashed in ring 0 :(\n");
|
||||||
|
dump_backtrace();
|
||||||
hang();
|
hang();
|
||||||
}
|
}
|
||||||
|
|
||||||
current->process().crash(SIGILL);
|
current->process().crash(SIGILL, regs.eip);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7: FPU not available exception
|
// 7: FPU not available exception
|
||||||
|
@ -224,10 +224,11 @@ void exception_0_handler(RegisterDump& regs)
|
||||||
|
|
||||||
if (current->process().is_ring0()) {
|
if (current->process().is_ring0()) {
|
||||||
kprintf("Oh shit, we've crashed in ring 0 :(\n");
|
kprintf("Oh shit, we've crashed in ring 0 :(\n");
|
||||||
|
dump_backtrace();
|
||||||
hang();
|
hang();
|
||||||
}
|
}
|
||||||
|
|
||||||
current->process().crash(SIGFPE);
|
current->process().crash(SIGFPE, regs.eip);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 13: General Protection Fault
|
// 13: General Protection Fault
|
||||||
|
@ -240,10 +241,11 @@ void exception_13_handler(RegisterDumpWithExceptionCode& regs)
|
||||||
|
|
||||||
if (current->process().is_ring0()) {
|
if (current->process().is_ring0()) {
|
||||||
kprintf("Oh shit, we've crashed in ring 0 :(\n");
|
kprintf("Oh shit, we've crashed in ring 0 :(\n");
|
||||||
|
dump_backtrace();
|
||||||
hang();
|
hang();
|
||||||
}
|
}
|
||||||
|
|
||||||
current->process().crash();
|
current->process().crash(SIGSEGV, regs.eip);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 14: Page Fault
|
// 14: Page Fault
|
||||||
|
@ -285,7 +287,7 @@ void exception_14_handler(RegisterDumpWithExceptionCode& regs)
|
||||||
regs.exception_code & 2 ? "write" : "read",
|
regs.exception_code & 2 ? "write" : "read",
|
||||||
faultAddress);
|
faultAddress);
|
||||||
dump(regs);
|
dump(regs);
|
||||||
current->process().crash();
|
current->process().crash(SIGSEGV, regs.eip);
|
||||||
} else if (response == PageFaultResponse::Continue) {
|
} else if (response == PageFaultResponse::Continue) {
|
||||||
#ifdef PAGE_FAULT_DEBUG
|
#ifdef PAGE_FAULT_DEBUG
|
||||||
dbgprintf("Continuing after resolved page fault\n");
|
dbgprintf("Continuing after resolved page fault\n");
|
||||||
|
|
|
@ -740,11 +740,13 @@ void Process::sys$sigreturn()
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Process::crash(int signal)
|
void Process::crash(int signal, dword eip)
|
||||||
{
|
{
|
||||||
ASSERT_INTERRUPTS_DISABLED();
|
ASSERT_INTERRUPTS_DISABLED();
|
||||||
ASSERT(!is_dead());
|
ASSERT(!is_dead());
|
||||||
|
|
||||||
|
if (m_elf_loader && ksyms_ready)
|
||||||
|
dbgprintf("\033[31;1m%p %s\033[0m\n", eip, m_elf_loader->symbolicate(eip).characters());
|
||||||
dump_backtrace();
|
dump_backtrace();
|
||||||
|
|
||||||
m_termination_signal = signal;
|
m_termination_signal = signal;
|
||||||
|
|
|
@ -204,7 +204,7 @@ public:
|
||||||
|
|
||||||
static void initialize();
|
static void initialize();
|
||||||
|
|
||||||
[[noreturn]] void crash(int signal = SIGSEGV);
|
[[noreturn]] void crash(int signal, dword eip);
|
||||||
[[nodiscard]] static int reap(Process&);
|
[[nodiscard]] static int reap(Process&);
|
||||||
|
|
||||||
const TTY* tty() const { return m_tty; }
|
const TTY* tty() const { return m_tty; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue