summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-03-06 20:17:34 +0100
committerGitHub <noreply@github.com>2019-03-06 20:17:34 +0100
commit8ee78521fa43e1098192493c62648360e3987260 (patch)
tree6ee1486d47e8c4539fc2fafe8f716aab4d893f22
parentMerge pull request #2194 from lioncash/mem (diff)
parentyuzu/debugger/wait_tree: Remove use of global CurrentProcess accessor (diff)
downloadyuzu-8ee78521fa43e1098192493c62648360e3987260.tar
yuzu-8ee78521fa43e1098192493c62648360e3987260.tar.gz
yuzu-8ee78521fa43e1098192493c62648360e3987260.tar.bz2
yuzu-8ee78521fa43e1098192493c62648360e3987260.tar.lz
yuzu-8ee78521fa43e1098192493c62648360e3987260.tar.xz
yuzu-8ee78521fa43e1098192493c62648360e3987260.tar.zst
yuzu-8ee78521fa43e1098192493c62648360e3987260.zip
-rw-r--r--src/yuzu/debugger/wait_tree.cpp8
-rw-r--r--src/yuzu/debugger/wait_tree.h3
2 files changed, 6 insertions, 5 deletions
diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp
index f50225d5f..06ad74ffe 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")));
}
diff --git a/src/yuzu/debugger/wait_tree.h b/src/yuzu/debugger/wait_tree.h
index 365c3dbfe..62886609d 100644
--- a/src/yuzu/debugger/wait_tree.h
+++ b/src/yuzu/debugger/wait_tree.h
@@ -17,6 +17,7 @@
class EmuThread;
namespace Kernel {
+class HandleTable;
class ReadableEvent;
class WaitObject;
class Thread;
@@ -72,7 +73,7 @@ public:
class WaitTreeMutexInfo : public WaitTreeExpandableItem {
Q_OBJECT
public:
- explicit WaitTreeMutexInfo(VAddr mutex_address);
+ explicit WaitTreeMutexInfo(VAddr mutex_address, const Kernel::HandleTable& handle_table);
~WaitTreeMutexInfo() override;
QString GetText() const override;