1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 08:57:47 +00:00

Kernel+CrashReporter: Add metadata about page faults to crash reports

Crash reports for page faults now tell you what kind of memory access
failed and where. :^)
This commit is contained in:
Andreas Kling 2021-04-04 20:11:54 +02:00
parent e238435c4f
commit 0b8226811f
4 changed files with 27 additions and 2 deletions

View file

@ -79,6 +79,13 @@ static TitleAndText build_backtrace(const CoreDump::Reader& coredump, const ELF:
else if (metadata.contains("pledge_violation"))
prepend_metadata("pledge_violation", "Has not pledged {}");
auto fault_address = metadata.get("fault_address");
auto fault_type = metadata.get("fault_type");
auto fault_access = metadata.get("fault_access");
if (fault_address.has_value() && fault_type.has_value() && fault_access.has_value()) {
builder.appendff("{} fault on {} at address {}\n\n", fault_type.value(), fault_access.value(), fault_address.value());
}
auto first_entry = true;
for (auto& entry : backtrace.entries()) {
if (first_entry)