1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00

Kernel: Generate coredump backtraces from "threads for coredump" list

This broke with the change that gave each process a list of its own
threads. Since threads are removed slightly earlier from that list
during process teardown, we're not able to use it for generating
coredump backtraces. Fortunately we have the "threads for coredump"
list for just this purpose. :^)
This commit is contained in:
Andreas Kling 2021-01-28 08:41:18 +01:00
parent b72f067f0d
commit 5ff355c0cd
4 changed files with 10 additions and 6 deletions

View file

@ -206,6 +206,9 @@ public:
template<typename Callback>
IterationDecision for_each_thread(Callback) const;
template<typename Callback>
IterationDecision for_each_thread_in_coredump(Callback) const;
void die();
void finalize();
@ -500,6 +503,8 @@ public:
HashMap<String, String>& coredump_metadata() { return m_coredump_metadata; }
const HashMap<String, String>& coredump_metadata() const { return m_coredump_metadata; }
const NonnullRefPtrVector<Thread>& threads_for_coredump(Badge<CoreDump>) const { return m_threads_for_coredump; }
PerformanceEventBuffer* perf_events() { return m_perf_event_buffer; }
private:
@ -662,7 +667,7 @@ private:
HashMap<String, String> m_coredump_metadata;
Vector<RefPtr<Thread>> m_threads_for_coredump;
NonnullRefPtrVector<Thread> m_threads_for_coredump;
};
extern InlineLinkedList<Process>* g_processes;