diff options
Diffstat (limited to 'src/core/debugger')
| -rw-r--r-- | src/core/debugger/debugger.cpp | 7 | ||||
| -rw-r--r-- | src/core/debugger/gdbstub.cpp | 6 |
2 files changed, 7 insertions, 6 deletions
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 @@ | |||
| 16 | #include "core/debugger/debugger_interface.h" | 16 | #include "core/debugger/debugger_interface.h" |
| 17 | #include "core/debugger/gdbstub.h" | 17 | #include "core/debugger/gdbstub.h" |
| 18 | #include "core/hle/kernel/global_scheduler_context.h" | 18 | #include "core/hle/kernel/global_scheduler_context.h" |
| 19 | #include "core/hle/kernel/k_process.h" | ||
| 19 | #include "core/hle/kernel/k_scheduler.h" | 20 | #include "core/hle/kernel/k_scheduler.h" |
| 20 | 21 | ||
| 21 | template <typename Readable, typename Buffer, typename Callback> | 22 | template <typename Readable, typename Buffer, typename Callback> |
| @@ -284,12 +285,12 @@ private: | |||
| 284 | void UpdateActiveThread() { | 285 | void UpdateActiveThread() { |
| 285 | const auto& threads{ThreadList()}; | 286 | const auto& threads{ThreadList()}; |
| 286 | if (std::find(threads.begin(), threads.end(), state->active_thread) == threads.end()) { | 287 | if (std::find(threads.begin(), threads.end(), state->active_thread) == threads.end()) { |
| 287 | state->active_thread = threads[0]; | 288 | state->active_thread = threads.front(); |
| 288 | } | 289 | } |
| 289 | } | 290 | } |
| 290 | 291 | ||
| 291 | const std::vector<Kernel::KThread*>& ThreadList() { | 292 | const std::list<Kernel::KThread*>& ThreadList() { |
| 292 | return system.GlobalSchedulerContext().GetThreadList(); | 293 | return system.ApplicationProcess()->GetThreadList(); |
| 293 | } | 294 | } |
| 294 | 295 | ||
| 295 | private: | 296 | 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) { | |||
| 573 | SendReply(PaginateBuffer(buffer, command.substr(21))); | 573 | SendReply(PaginateBuffer(buffer, command.substr(21))); |
| 574 | } else if (command.starts_with("fThreadInfo")) { | 574 | } else if (command.starts_with("fThreadInfo")) { |
| 575 | // beginning of list | 575 | // beginning of list |
| 576 | const auto& threads = system.GlobalSchedulerContext().GetThreadList(); | 576 | const auto& threads = system.ApplicationProcess()->GetThreadList(); |
| 577 | std::vector<std::string> thread_ids; | 577 | std::vector<std::string> thread_ids; |
| 578 | for (const auto& thread : threads) { | 578 | for (const auto& thread : threads) { |
| 579 | thread_ids.push_back(fmt::format("{:x}", thread->GetThreadID())); | 579 | thread_ids.push_back(fmt::format("{:x}", thread->GetThreadID())); |
| @@ -587,7 +587,7 @@ void GDBStub::HandleQuery(std::string_view command) { | |||
| 587 | buffer += R"(<?xml version="1.0"?>)"; | 587 | buffer += R"(<?xml version="1.0"?>)"; |
| 588 | buffer += "<threads>"; | 588 | buffer += "<threads>"; |
| 589 | 589 | ||
| 590 | const auto& threads = system.GlobalSchedulerContext().GetThreadList(); | 590 | const auto& threads = system.ApplicationProcess()->GetThreadList(); |
| 591 | for (const auto* thread : threads) { | 591 | for (const auto* thread : threads) { |
| 592 | auto thread_name{GetThreadName(system, thread)}; | 592 | auto thread_name{GetThreadName(system, thread)}; |
| 593 | if (!thread_name) { | 593 | if (!thread_name) { |
| @@ -817,7 +817,7 @@ void GDBStub::HandleRcmd(const std::vector<u8>& command) { | |||
| 817 | } | 817 | } |
| 818 | 818 | ||
| 819 | Kernel::KThread* GDBStub::GetThreadByID(u64 thread_id) { | 819 | Kernel::KThread* GDBStub::GetThreadByID(u64 thread_id) { |
| 820 | const auto& threads{system.GlobalSchedulerContext().GetThreadList()}; | 820 | const auto& threads{system.ApplicationProcess()->GetThreadList()}; |
| 821 | for (auto* thread : threads) { | 821 | for (auto* thread : threads) { |
| 822 | if (thread->GetThreadID() == thread_id) { | 822 | if (thread->GetThreadID() == thread_id) { |
| 823 | return thread; | 823 | return thread; |