summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2019-05-19 00:47:34 -0400
committerGravatar Lioncash2019-05-19 01:10:05 -0400
commita059b9eed49ef66430014b9c2a2794cb296c32cd (patch)
tree8eecf2edff3144632ad60b1a2e3c68bf8e331d6f /src
parentMerge pull request #2457 from lioncash/about (diff)
downloadyuzu-a059b9eed49ef66430014b9c2a2794cb296c32cd.tar.gz
yuzu-a059b9eed49ef66430014b9c2a2794cb296c32cd.tar.xz
yuzu-a059b9eed49ef66430014b9c2a2794cb296c32cd.zip
yuzu/debugger/wait_tree: Specify string conversions explicitly
Allows compiling the wait tree widget with implicit string conversions disabled.
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/debugger/wait_tree.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp
index 85b095688..abf5b8f22 100644
--- a/src/yuzu/debugger/wait_tree.cpp
+++ b/src/yuzu/debugger/wait_tree.cpp
@@ -91,19 +91,19 @@ WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address, const Kernel::HandleTa
91WaitTreeMutexInfo::~WaitTreeMutexInfo() = default; 91WaitTreeMutexInfo::~WaitTreeMutexInfo() = default;
92 92
93QString WaitTreeMutexInfo::GetText() const { 93QString WaitTreeMutexInfo::GetText() const {
94 return tr("waiting for mutex 0x%1").arg(mutex_address, 16, 16, QLatin1Char('0')); 94 return tr("waiting for mutex 0x%1").arg(mutex_address, 16, 16, QLatin1Char{'0'});
95} 95}
96 96
97std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeMutexInfo::GetChildren() const { 97std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeMutexInfo::GetChildren() const {
98 std::vector<std::unique_ptr<WaitTreeItem>> list; 98 const bool has_waiters = (mutex_value & Kernel::Mutex::MutexHasWaitersFlag) != 0;
99
100 bool has_waiters = (mutex_value & Kernel::Mutex::MutexHasWaitersFlag) != 0;
101 99
100 std::vector<std::unique_ptr<WaitTreeItem>> list;
102 list.push_back(std::make_unique<WaitTreeText>(tr("has waiters: %1").arg(has_waiters))); 101 list.push_back(std::make_unique<WaitTreeText>(tr("has waiters: %1").arg(has_waiters)));
103 list.push_back(std::make_unique<WaitTreeText>( 102 list.push_back(std::make_unique<WaitTreeText>(
104 tr("owner handle: 0x%1").arg(owner_handle, 8, 16, QLatin1Char('0')))); 103 tr("owner handle: 0x%1").arg(owner_handle, 8, 16, QLatin1Char{'0'})));
105 if (owner != nullptr) 104 if (owner != nullptr) {
106 list.push_back(std::make_unique<WaitTreeThread>(*owner)); 105 list.push_back(std::make_unique<WaitTreeThread>(*owner));
106 }
107 return list; 107 return list;
108} 108}
109 109
@@ -121,11 +121,14 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeCallstack::GetChildren() cons
121 u64 base_pointer = thread.GetContext().cpu_registers[BaseRegister]; 121 u64 base_pointer = thread.GetContext().cpu_registers[BaseRegister];
122 122
123 while (base_pointer != 0) { 123 while (base_pointer != 0) {
124 u64 lr = Memory::Read64(base_pointer + sizeof(u64)); 124 const u64 lr = Memory::Read64(base_pointer + sizeof(u64));
125 if (lr == 0) 125 if (lr == 0) {
126 break; 126 break;
127 list.push_back( 127 }
128 std::make_unique<WaitTreeText>(tr("0x%1").arg(lr - sizeof(u32), 16, 16, QChar('0')))); 128
129 list.push_back(std::make_unique<WaitTreeText>(
130 tr("0x%1").arg(lr - sizeof(u32), 16, 16, QLatin1Char{'0'})));
131
129 base_pointer = Memory::Read64(base_pointer); 132 base_pointer = Memory::Read64(base_pointer);
130 } 133 }
131 134
@@ -249,9 +252,9 @@ QString WaitTreeThread::GetText() const {
249 252
250 const auto& context = thread.GetContext(); 253 const auto& context = thread.GetContext();
251 const QString pc_info = tr(" PC = 0x%1 LR = 0x%2") 254 const QString pc_info = tr(" PC = 0x%1 LR = 0x%2")
252 .arg(context.pc, 8, 16, QLatin1Char('0')) 255 .arg(context.pc, 8, 16, QLatin1Char{'0'})
253 .arg(context.cpu_registers[30], 8, 16, QLatin1Char('0')); 256 .arg(context.cpu_registers[30], 8, 16, QLatin1Char{'0'});
254 return WaitTreeWaitObject::GetText() + pc_info + " (" + status + ") "; 257 return QStringLiteral("%1%2 (%3) ").arg(WaitTreeWaitObject::GetText(), pc_info, status);
255} 258}
256 259
257QColor WaitTreeThread::GetColor() const { 260QColor WaitTreeThread::GetColor() const {
@@ -424,7 +427,7 @@ void WaitTreeModel::InitItems() {
424} 427}
425 428
426WaitTreeWidget::WaitTreeWidget(QWidget* parent) : QDockWidget(tr("Wait Tree"), parent) { 429WaitTreeWidget::WaitTreeWidget(QWidget* parent) : QDockWidget(tr("Wait Tree"), parent) {
427 setObjectName("WaitTreeWidget"); 430 setObjectName(QStringLiteral("WaitTreeWidget"));
428 view = new QTreeView(this); 431 view = new QTreeView(this);
429 view->setHeaderHidden(true); 432 view->setHeaderHidden(true);
430 setWidget(view); 433 setWidget(view);