1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:57:42 +00:00

Kernel: Store coredump metadata properties as KStrings

This patch also replaces the HashMap previously used to store coredump
properties with a plain AK::Array.
This commit is contained in:
Andreas Kling 2021-08-05 23:43:10 +02:00
parent 95669fa861
commit 33adc3a42d
6 changed files with 55 additions and 24 deletions

View file

@ -382,14 +382,14 @@ void page_fault_handler(TrapFrame* trap)
if (current_thread) {
auto& current_process = current_thread->process();
if (current_process.is_user_process()) {
current_process.set_coredump_metadata("fault_address", String::formatted("{:p}", fault_address));
current_process.set_coredump_metadata("fault_type", fault.type() == PageFault::Type::PageNotPresent ? "NotPresent" : "ProtectionViolation");
(void)current_process.try_set_coredump_property("fault_address", String::formatted("{:p}", fault_address));
(void)current_process.try_set_coredump_property("fault_type", fault.type() == PageFault::Type::PageNotPresent ? "NotPresent" : "ProtectionViolation");
String fault_access;
if (fault.is_instruction_fetch())
fault_access = "Execute";
else
fault_access = fault.access() == PageFault::Access::Read ? "Read" : "Write";
current_process.set_coredump_metadata("fault_access", fault_access);
(void)current_process.try_set_coredump_property("fault_access", fault_access);
}
}