mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:17:45 +00:00
CrashReporter: Fix showing assertion info in backtrace
This was needlessly expecting the first backtrace entry function name to start with '__assertion_failed', which is no longer the case - it's now something from libsystem.so. Let's just check whether we have an 'assertion' key in the coredump's metadata, just like we do for pledge violations.
This commit is contained in:
parent
7df61e2c9b
commit
8d0b744ebb
1 changed files with 9 additions and 7 deletions
|
@ -69,17 +69,19 @@ static TitleAndText build_backtrace(const CoreDump::Reader& coredump, const ELF:
|
||||||
builder.append('\n');
|
builder.append('\n');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
auto& backtrace_entries = backtrace.entries();
|
||||||
|
|
||||||
|
if (coredump.metadata().contains("assertion"))
|
||||||
|
prepend_metadata("assertion", "ASSERTION FAILED: {}");
|
||||||
|
else if (coredump.metadata().contains("pledge_violation"))
|
||||||
|
prepend_metadata("pledge_violation", "Has not pledged {}");
|
||||||
|
|
||||||
auto first_entry = true;
|
auto first_entry = true;
|
||||||
for (auto& entry : backtrace.entries()) {
|
for (auto& entry : backtrace.entries()) {
|
||||||
if (first_entry) {
|
if (first_entry)
|
||||||
if (entry.function_name.starts_with("__assertion_failed"))
|
|
||||||
prepend_metadata("assertion", "ASSERTION FAILED: {}");
|
|
||||||
else if (coredump.metadata().contains("pledge_violation"))
|
|
||||||
prepend_metadata("pledge_violation", "Has not pledged {}");
|
|
||||||
first_entry = false;
|
first_entry = false;
|
||||||
} else {
|
else
|
||||||
builder.append('\n');
|
builder.append('\n');
|
||||||
}
|
|
||||||
builder.append(entry.to_string());
|
builder.append(entry.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue