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

LibCoreDump+Crash{Daemon,Reporter}: Make backtraces thread-specific

We want to show an individual backtrace for each thread, not one
containing backtrace entries from all threads.

Fixes #4778.
This commit is contained in:
Linus Groh 2021-01-15 20:46:59 +01:00 committed by Andreas Kling
parent 057ae36e32
commit 7668e968af
6 changed files with 86 additions and 46 deletions

View file

@ -56,8 +56,18 @@ static void print_backtrace(const String& coredump_path)
dbgln("Could not open coredump '{}'", coredump_path);
return;
}
for (auto& entry : coredump->backtrace().entries())
dbgln("{}", entry.to_string(true));
size_t thread_index = 0;
coredump->for_each_thread_info([&](auto& thread_info) {
CoreDump::Backtrace backtrace(*coredump, thread_info);
if (thread_index > 0)
dbgln();
dbgln("--- Backtrace for thread #{} (TID {}) ---", thread_index, thread_info.tid);
for (auto& entry : backtrace.entries())
dbgln("{}", entry.to_string(true));
++thread_index;
return IterationDecision::Continue;
});
}
static void launch_crash_reporter(const String& coredump_path)