aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/debugger/wait_tree.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-05 21:52:19 -0500
committerLioncash <mathew1800@gmail.com>2019-03-05 21:52:21 -0500
commit2c92a30baacd11b7a39c46496f359b17724ba967 (patch)
tree08a93afcbb8e67f1d0cbd1c83cd36ded534d3273 /src/yuzu/debugger/wait_tree.cpp
parent999a48c856d5f4832f02e9b1120d24085b7c3fb3 (diff)
yuzu/debugger/wait_tree: Remove use of global CurrentProcess accessor
We already have the thread instance that was created under the current process, so we can just pass the handle table of it along to retrieve the owner of the mutex.
Diffstat (limited to 'src/yuzu/debugger/wait_tree.cpp')
-rw-r--r--src/yuzu/debugger/wait_tree.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp
index f50225d5f6..06ad74ffe3 100644
--- a/src/yuzu/debugger/wait_tree.cpp
+++ b/src/yuzu/debugger/wait_tree.cpp
@@ -81,9 +81,8 @@ QString WaitTreeText::GetText() const {
return text;
}
-WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address) : mutex_address(mutex_address) {
- const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
-
+WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address, const Kernel::HandleTable& handle_table)
+ : mutex_address(mutex_address) {
mutex_value = Memory::Read32(mutex_address);
owner_handle = static_cast<Kernel::Handle>(mutex_value & Kernel::Mutex::MutexOwnerMask);
owner = handle_table.Get<Kernel::Thread>(owner_handle);
@@ -316,7 +315,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const {
const VAddr mutex_wait_address = thread.GetMutexWaitAddress();
if (mutex_wait_address != 0) {
- list.push_back(std::make_unique<WaitTreeMutexInfo>(mutex_wait_address));
+ const auto& handle_table = thread.GetOwnerProcess()->GetHandleTable();
+ list.push_back(std::make_unique<WaitTreeMutexInfo>(mutex_wait_address, handle_table));
} else {
list.push_back(std::make_unique<WaitTreeText>(tr("not waiting for mutex")));
}