mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
Kernel: Make CrashHandler
more useful before init_stage2
Display some helpful information about crashes even before the first process is started.
This commit is contained in:
parent
466153e680
commit
e4019ba9dc
1 changed files with 11 additions and 2 deletions
|
@ -16,8 +16,17 @@ namespace Kernel {
|
|||
void handle_crash(Kernel::RegisterState const& regs, char const* description, int signal, bool out_of_memory)
|
||||
{
|
||||
auto* current_thread = Thread::current();
|
||||
if (!current_thread)
|
||||
PANIC("{} with !Thread::current()", description);
|
||||
if (!current_thread) {
|
||||
VERIFY(regs.previous_mode() == ExecutionMode::Kernel);
|
||||
|
||||
dbgln("CRASH: CPU #{} {} in kernel", Processor::current_id(), description);
|
||||
|
||||
dump_registers(regs);
|
||||
if (Memory::MemoryManager::is_initialized())
|
||||
MM.dump_kernel_regions();
|
||||
|
||||
PANIC("Crash in kernel with !Thread::current()");
|
||||
}
|
||||
|
||||
auto crashed_in_kernel = regs.previous_mode() == ExecutionMode::Kernel;
|
||||
if (!crashed_in_kernel && current_thread->has_signal_handler(signal) && !current_thread->should_ignore_signal(signal) && !current_thread->is_signal_masked(signal)) {
|
||||
|
|
Loading…
Reference in a new issue