|
|
@ -12,8 +12,8 @@
|
|
|
|
#include "core/hle/kernel/process.h"
|
|
|
|
#include "core/hle/kernel/process.h"
|
|
|
|
#include "core/hle/kernel/readable_event.h"
|
|
|
|
#include "core/hle/kernel/readable_event.h"
|
|
|
|
#include "core/hle/kernel/scheduler.h"
|
|
|
|
#include "core/hle/kernel/scheduler.h"
|
|
|
|
|
|
|
|
#include "core/hle/kernel/synchronization_object.h"
|
|
|
|
#include "core/hle/kernel/thread.h"
|
|
|
|
#include "core/hle/kernel/thread.h"
|
|
|
|
#include "core/hle/kernel/wait_object.h"
|
|
|
|
|
|
|
|
#include "core/memory.h"
|
|
|
|
#include "core/memory.h"
|
|
|
|
|
|
|
|
|
|
|
|
WaitTreeItem::WaitTreeItem() = default;
|
|
|
|
WaitTreeItem::WaitTreeItem() = default;
|
|
|
@ -133,8 +133,9 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeCallstack::GetChildren() cons
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WaitTreeWaitObject::WaitTreeWaitObject(const Kernel::WaitObject& o) : object(o) {}
|
|
|
|
WaitTreeSynchronizationObject::WaitTreeSynchronizationObject(const Kernel::SynchronizationObject& o)
|
|
|
|
WaitTreeWaitObject::~WaitTreeWaitObject() = default;
|
|
|
|
: object(o) {}
|
|
|
|
|
|
|
|
WaitTreeSynchronizationObject::~WaitTreeSynchronizationObject() = default;
|
|
|
|
|
|
|
|
|
|
|
|
WaitTreeExpandableItem::WaitTreeExpandableItem() = default;
|
|
|
|
WaitTreeExpandableItem::WaitTreeExpandableItem() = default;
|
|
|
|
WaitTreeExpandableItem::~WaitTreeExpandableItem() = default;
|
|
|
|
WaitTreeExpandableItem::~WaitTreeExpandableItem() = default;
|
|
|
@ -143,25 +144,26 @@ bool WaitTreeExpandableItem::IsExpandable() const {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString WaitTreeWaitObject::GetText() const {
|
|
|
|
QString WaitTreeSynchronizationObject::GetText() const {
|
|
|
|
return tr("[%1]%2 %3")
|
|
|
|
return tr("[%1]%2 %3")
|
|
|
|
.arg(object.GetObjectId())
|
|
|
|
.arg(object.GetObjectId())
|
|
|
|
.arg(QString::fromStdString(object.GetTypeName()),
|
|
|
|
.arg(QString::fromStdString(object.GetTypeName()),
|
|
|
|
QString::fromStdString(object.GetName()));
|
|
|
|
QString::fromStdString(object.GetName()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<WaitTreeWaitObject> WaitTreeWaitObject::make(const Kernel::WaitObject& object) {
|
|
|
|
std::unique_ptr<WaitTreeSynchronizationObject> WaitTreeSynchronizationObject::make(
|
|
|
|
|
|
|
|
const Kernel::SynchronizationObject& object) {
|
|
|
|
switch (object.GetHandleType()) {
|
|
|
|
switch (object.GetHandleType()) {
|
|
|
|
case Kernel::HandleType::ReadableEvent:
|
|
|
|
case Kernel::HandleType::ReadableEvent:
|
|
|
|
return std::make_unique<WaitTreeEvent>(static_cast<const Kernel::ReadableEvent&>(object));
|
|
|
|
return std::make_unique<WaitTreeEvent>(static_cast<const Kernel::ReadableEvent&>(object));
|
|
|
|
case Kernel::HandleType::Thread:
|
|
|
|
case Kernel::HandleType::Thread:
|
|
|
|
return std::make_unique<WaitTreeThread>(static_cast<const Kernel::Thread&>(object));
|
|
|
|
return std::make_unique<WaitTreeThread>(static_cast<const Kernel::Thread&>(object));
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return std::make_unique<WaitTreeWaitObject>(object);
|
|
|
|
return std::make_unique<WaitTreeSynchronizationObject>(object);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeWaitObject::GetChildren() const {
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeSynchronizationObject::GetChildren() const {
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> list;
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> list;
|
|
|
|
|
|
|
|
|
|
|
|
const auto& threads = object.GetWaitingThreads();
|
|
|
|
const auto& threads = object.GetWaitingThreads();
|
|
|
@ -173,8 +175,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeWaitObject::GetChildren() con
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WaitTreeObjectList::WaitTreeObjectList(const std::vector<std::shared_ptr<Kernel::WaitObject>>& list,
|
|
|
|
WaitTreeObjectList::WaitTreeObjectList(
|
|
|
|
bool w_all)
|
|
|
|
const std::vector<std::shared_ptr<Kernel::SynchronizationObject>>& list, bool w_all)
|
|
|
|
: object_list(list), wait_all(w_all) {}
|
|
|
|
: object_list(list), wait_all(w_all) {}
|
|
|
|
|
|
|
|
|
|
|
|
WaitTreeObjectList::~WaitTreeObjectList() = default;
|
|
|
|
WaitTreeObjectList::~WaitTreeObjectList() = default;
|
|
|
@ -188,11 +190,12 @@ QString WaitTreeObjectList::GetText() const {
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeObjectList::GetChildren() const {
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeObjectList::GetChildren() const {
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> list(object_list.size());
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> list(object_list.size());
|
|
|
|
std::transform(object_list.begin(), object_list.end(), list.begin(),
|
|
|
|
std::transform(object_list.begin(), object_list.end(), list.begin(),
|
|
|
|
[](const auto& t) { return WaitTreeWaitObject::make(*t); });
|
|
|
|
[](const auto& t) { return WaitTreeSynchronizationObject::make(*t); });
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WaitTreeThread::WaitTreeThread(const Kernel::Thread& thread) : WaitTreeWaitObject(thread) {}
|
|
|
|
WaitTreeThread::WaitTreeThread(const Kernel::Thread& thread)
|
|
|
|
|
|
|
|
: WaitTreeSynchronizationObject(thread) {}
|
|
|
|
WaitTreeThread::~WaitTreeThread() = default;
|
|
|
|
WaitTreeThread::~WaitTreeThread() = default;
|
|
|
|
|
|
|
|
|
|
|
|
QString WaitTreeThread::GetText() const {
|
|
|
|
QString WaitTreeThread::GetText() const {
|
|
|
@ -241,7 +244,8 @@ QString WaitTreeThread::GetText() const {
|
|
|
|
const QString pc_info = tr(" PC = 0x%1 LR = 0x%2")
|
|
|
|
const QString pc_info = tr(" PC = 0x%1 LR = 0x%2")
|
|
|
|
.arg(context.pc, 8, 16, QLatin1Char{'0'})
|
|
|
|
.arg(context.pc, 8, 16, QLatin1Char{'0'})
|
|
|
|
.arg(context.cpu_registers[30], 8, 16, QLatin1Char{'0'});
|
|
|
|
.arg(context.cpu_registers[30], 8, 16, QLatin1Char{'0'});
|
|
|
|
return QStringLiteral("%1%2 (%3) ").arg(WaitTreeWaitObject::GetText(), pc_info, status);
|
|
|
|
return QStringLiteral("%1%2 (%3) ")
|
|
|
|
|
|
|
|
.arg(WaitTreeSynchronizationObject::GetText(), pc_info, status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QColor WaitTreeThread::GetColor() const {
|
|
|
|
QColor WaitTreeThread::GetColor() const {
|
|
|
@ -273,7 +277,7 @@ QColor WaitTreeThread::GetColor() const {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const {
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const {
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeWaitObject::GetChildren());
|
|
|
|
std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeSynchronizationObject::GetChildren());
|
|
|
|
|
|
|
|
|
|
|
|
const auto& thread = static_cast<const Kernel::Thread&>(object);
|
|
|
|
const auto& thread = static_cast<const Kernel::Thread&>(object);
|
|
|
|
|
|
|
|
|
|
|
@ -314,7 +318,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (thread.GetStatus() == Kernel::ThreadStatus::WaitSynch) {
|
|
|
|
if (thread.GetStatus() == Kernel::ThreadStatus::WaitSynch) {
|
|
|
|
list.push_back(std::make_unique<WaitTreeObjectList>(thread.GetWaitObjects(),
|
|
|
|
list.push_back(std::make_unique<WaitTreeObjectList>(thread.GetSynchronizationObjects(),
|
|
|
|
thread.IsSleepingOnWait()));
|
|
|
|
thread.IsSleepingOnWait()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -323,7 +327,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const {
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
WaitTreeEvent::WaitTreeEvent(const Kernel::ReadableEvent& object) : WaitTreeWaitObject(object) {}
|
|
|
|
WaitTreeEvent::WaitTreeEvent(const Kernel::ReadableEvent& object)
|
|
|
|
|
|
|
|
: WaitTreeSynchronizationObject(object) {}
|
|
|
|
WaitTreeEvent::~WaitTreeEvent() = default;
|
|
|
|
WaitTreeEvent::~WaitTreeEvent() = default;
|
|
|
|
|
|
|
|
|
|
|
|
WaitTreeThreadList::WaitTreeThreadList(const std::vector<std::shared_ptr<Kernel::Thread>>& list)
|
|
|
|
WaitTreeThreadList::WaitTreeThreadList(const std::vector<std::shared_ptr<Kernel::Thread>>& list)
|
|
|
|