mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-12 17:37:53 +03: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
Notes:
sideshowbarker
2024-07-18 22:09:01 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/8d0b744ebb1 Pull-request: https://github.com/SerenityOS/serenity/pull/5413
@ -69,17 +69,19 @@ static TitleAndText build_backtrace(const CoreDump::Reader& coredump, const ELF:
|
||||
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;
|
||||
for (auto& entry : backtrace.entries()) {
|
||||
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 {}");
|
||||
if (first_entry)
|
||||
first_entry = false;
|
||||
} else {
|
||||
else
|
||||
builder.append('\n');
|
||||
}
|
||||
builder.append(entry.to_string());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user