mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
Kernel: Generate a coredump file when a process crashes
When a process crashes, we generate a coredump file and write it in /tmp/coredumps/. The coredump file is an ELF file of type ET_CORE. It contains a segment for every userspace memory region of the process, and an additional PT_NOTE segment that contains the registers state for each thread, and a additional data about memory regions (e.g their name).
This commit is contained in:
@@ -734,6 +734,7 @@ DispatchSignalResult Thread::dispatch_signal(u8 signal)
|
||||
set_state(Stopped, signal);
|
||||
return DispatchSignalResult::Yield;
|
||||
case DefaultSignalAction::DumpCore:
|
||||
process.set_dump_core(true);
|
||||
process.for_each_thread([](auto& thread) {
|
||||
thread.set_dump_backtrace_on_finalization();
|
||||
return IterationDecision::Continue;
|
||||
|
||||
Reference in New Issue
Block a user