Add thread debugger

This commit is contained in:
wheremyfoodat 2025-07-03 16:58:56 +03:00
parent 228068901b
commit 9932e58bf0
10 changed files with 172 additions and 14 deletions

View file

@ -1,3 +1,4 @@
#include <algorithm>
#include <bit>
#include <cassert>
#include <cstring>
@ -697,3 +698,18 @@ bool Kernel::shouldWaitOnObject(KernelObject* object) {
return true;
}
}
std::vector<Thread> Kernel::getMainProcessThreads() {
// Sort the thread indices so that they appear nicer in the debugger
auto indices = threadIndices;
std::sort(indices.begin(), indices.end());
std::vector<Thread> ret;
ret.reserve(indices.size());
for (const auto& index : indices) {
ret.push_back(threads[index]);
}
return ret;
}