diff options
author | David <25727384+ogniK5377@users.noreply.github.com> | 2019-10-28 00:53:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-28 00:53:27 +0100 |
commit | 4c5731c34f0915457a31c60c9f70a2f169ea575d (patch) | |
tree | 7f03a7f892370b59e56ae06c6c74514f1cc44998 /src/core/gdbstub | |
parent | Merge pull request #3034 from ReinUsesLisp/w4244-maxwell3d (diff) | |
parent | Kernel Thread: Cleanup THREADPROCESSORID_DONT_UPDATE. (diff) | |
download | yuzu-4c5731c34f0915457a31c60c9f70a2f169ea575d.tar yuzu-4c5731c34f0915457a31c60c9f70a2f169ea575d.tar.gz yuzu-4c5731c34f0915457a31c60c9f70a2f169ea575d.tar.bz2 yuzu-4c5731c34f0915457a31c60c9f70a2f169ea575d.tar.lz yuzu-4c5731c34f0915457a31c60c9f70a2f169ea575d.tar.xz yuzu-4c5731c34f0915457a31c60c9f70a2f169ea575d.tar.zst yuzu-4c5731c34f0915457a31c60c9f70a2f169ea575d.zip |
Diffstat (limited to 'src/core/gdbstub')
-rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index db51d722f..20bb50868 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -202,13 +202,11 @@ void RegisterModule(std::string name, VAddr beg, VAddr end, bool add_elf_ext) { } static Kernel::Thread* FindThreadById(s64 id) { - for (u32 core = 0; core < Core::NUM_CPU_CORES; core++) { - const auto& threads = Core::System::GetInstance().Scheduler(core).GetThreadList(); - for (auto& thread : threads) { - if (thread->GetThreadID() == static_cast<u64>(id)) { - current_core = core; - return thread.get(); - } + const auto& threads = Core::System::GetInstance().GlobalScheduler().GetThreadList(); + for (auto& thread : threads) { + if (thread->GetThreadID() == static_cast<u64>(id)) { + current_core = thread->GetProcessorID(); + return thread.get(); } } return nullptr; @@ -647,11 +645,9 @@ static void HandleQuery() { SendReply(buffer.c_str()); } else if (strncmp(query, "fThreadInfo", strlen("fThreadInfo")) == 0) { std::string val = "m"; - for (u32 core = 0; core < Core::NUM_CPU_CORES; core++) { - const auto& threads = Core::System::GetInstance().Scheduler(core).GetThreadList(); - for (const auto& thread : threads) { - val += fmt::format("{:x},", thread->GetThreadID()); - } + const auto& threads = Core::System::GetInstance().GlobalScheduler().GetThreadList(); + for (const auto& thread : threads) { + val += fmt::format("{:x},", thread->GetThreadID()); } val.pop_back(); SendReply(val.c_str()); @@ -661,13 +657,11 @@ static void HandleQuery() { std::string buffer; buffer += "l<?xml version=\"1.0\"?>"; buffer += "<threads>"; - for (u32 core = 0; core < Core::NUM_CPU_CORES; core++) { - const auto& threads = Core::System::GetInstance().Scheduler(core).GetThreadList(); - for (const auto& thread : threads) { - buffer += - fmt::format(R"*(<thread id="{:x}" core="{:d}" name="Thread {:x}"></thread>)*", - thread->GetThreadID(), core, thread->GetThreadID()); - } + const auto& threads = Core::System::GetInstance().GlobalScheduler().GetThreadList(); + for (const auto& thread : threads) { + buffer += + fmt::format(R"*(<thread id="{:x}" core="{:d}" name="Thread {:x}"></thread>)*", + thread->GetThreadID(), thread->GetProcessorID(), thread->GetThreadID()); } buffer += "</threads>"; SendReply(buffer.c_str()); |