Merge pull request #2204 from lioncash/wait-tree

yuzu/debugger/wait_tree: Remove use of global CurrentProcess accessor
This commit is contained in:
bunnei 2019-03-06 14:17:34 -05:00 committed by GitHub
commit 8ee78521fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -81,9 +81,8 @@ QString WaitTreeText::GetText() const {
return text; return text;
} }
WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address) : mutex_address(mutex_address) { WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address, const Kernel::HandleTable& handle_table)
const auto& handle_table = Core::CurrentProcess()->GetHandleTable(); : mutex_address(mutex_address) {
mutex_value = Memory::Read32(mutex_address); mutex_value = Memory::Read32(mutex_address);
owner_handle = static_cast<Kernel::Handle>(mutex_value & Kernel::Mutex::MutexOwnerMask); owner_handle = static_cast<Kernel::Handle>(mutex_value & Kernel::Mutex::MutexOwnerMask);
owner = handle_table.Get<Kernel::Thread>(owner_handle); 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(); const VAddr mutex_wait_address = thread.GetMutexWaitAddress();
if (mutex_wait_address != 0) { 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 { } else {
list.push_back(std::make_unique<WaitTreeText>(tr("not waiting for mutex"))); list.push_back(std::make_unique<WaitTreeText>(tr("not waiting for mutex")));
} }

View file

@ -17,6 +17,7 @@
class EmuThread; class EmuThread;
namespace Kernel { namespace Kernel {
class HandleTable;
class ReadableEvent; class ReadableEvent;
class WaitObject; class WaitObject;
class Thread; class Thread;
@ -72,7 +73,7 @@ public:
class WaitTreeMutexInfo : public WaitTreeExpandableItem { class WaitTreeMutexInfo : public WaitTreeExpandableItem {
Q_OBJECT Q_OBJECT
public: public:
explicit WaitTreeMutexInfo(VAddr mutex_address); explicit WaitTreeMutexInfo(VAddr mutex_address, const Kernel::HandleTable& handle_table);
~WaitTreeMutexInfo() override; ~WaitTreeMutexInfo() override;
QString GetText() const override; QString GetText() const override;