From a9369726147c7499e0016e183d5d56a7b44efe4b Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 18 Feb 2023 16:26:48 -0500 Subject: service: refactor server architecture Converts services to have their own processes --- src/core/debugger/debugger.cpp | 7 ++++--- src/core/debugger/gdbstub.cpp | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/core/debugger') diff --git a/src/core/debugger/debugger.cpp b/src/core/debugger/debugger.cpp index a9675df76..a1589fecb 100644 --- a/src/core/debugger/debugger.cpp +++ b/src/core/debugger/debugger.cpp @@ -16,6 +16,7 @@ #include "core/debugger/debugger_interface.h" #include "core/debugger/gdbstub.h" #include "core/hle/kernel/global_scheduler_context.h" +#include "core/hle/kernel/k_process.h" #include "core/hle/kernel/k_scheduler.h" template @@ -284,12 +285,12 @@ private: void UpdateActiveThread() { const auto& threads{ThreadList()}; if (std::find(threads.begin(), threads.end(), state->active_thread) == threads.end()) { - state->active_thread = threads[0]; + state->active_thread = threads.front(); } } - const std::vector& ThreadList() { - return system.GlobalSchedulerContext().GetThreadList(); + const std::list& ThreadList() { + return system.ApplicationProcess()->GetThreadList(); } private: diff --git a/src/core/debugger/gdbstub.cpp b/src/core/debugger/gdbstub.cpp index 945ec528e..18afe97e1 100644 --- a/src/core/debugger/gdbstub.cpp +++ b/src/core/debugger/gdbstub.cpp @@ -573,7 +573,7 @@ void GDBStub::HandleQuery(std::string_view command) { SendReply(PaginateBuffer(buffer, command.substr(21))); } else if (command.starts_with("fThreadInfo")) { // beginning of list - const auto& threads = system.GlobalSchedulerContext().GetThreadList(); + const auto& threads = system.ApplicationProcess()->GetThreadList(); std::vector thread_ids; for (const auto& thread : threads) { thread_ids.push_back(fmt::format("{:x}", thread->GetThreadID())); @@ -587,7 +587,7 @@ void GDBStub::HandleQuery(std::string_view command) { buffer += R"()"; buffer += ""; - const auto& threads = system.GlobalSchedulerContext().GetThreadList(); + const auto& threads = system.ApplicationProcess()->GetThreadList(); for (const auto* thread : threads) { auto thread_name{GetThreadName(system, thread)}; if (!thread_name) { @@ -817,7 +817,7 @@ void GDBStub::HandleRcmd(const std::vector& command) { } Kernel::KThread* GDBStub::GetThreadByID(u64 thread_id) { - const auto& threads{system.GlobalSchedulerContext().GetThreadList()}; + const auto& threads{system.ApplicationProcess()->GetThreadList()}; for (auto* thread : threads) { if (thread->GetThreadID() == thread_id) { return thread; -- cgit v1.2.3