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:
parent
057ae36e32
commit
7668e968af
6 changed files with 86 additions and 46 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue