diff options
| author | 2019-05-19 14:49:54 +0100 | |
|---|---|---|
| committer | 2019-05-19 14:49:54 +0100 | |
| commit | 209a0dfa35aa54ae68b37189ade006dc5051090e (patch) | |
| tree | 0bf3852372448d9109af0eea83f5b374898336f0 /src | |
| parent | Merge pull request #2486 from lioncash/resetname (diff) | |
| parent | yuzu/debugger/graphics/graphics_breakpoints: Specify string conversions expli... (diff) | |
| download | yuzu-209a0dfa35aa54ae68b37189ade006dc5051090e.tar.gz yuzu-209a0dfa35aa54ae68b37189ade006dc5051090e.tar.xz yuzu-209a0dfa35aa54ae68b37189ade006dc5051090e.zip | |
Merge pull request #2492 from lioncash/debugger
yuzu/debugger: Specify string conversions explicitly
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/debugger/graphics/graphics_breakpoints.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/debugger/profiler.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/debugger/wait_tree.cpp | 31 |
3 files changed, 20 insertions, 17 deletions
diff --git a/src/yuzu/debugger/graphics/graphics_breakpoints.cpp b/src/yuzu/debugger/graphics/graphics_breakpoints.cpp index 67ed0ba6d..1c80082a4 100644 --- a/src/yuzu/debugger/graphics/graphics_breakpoints.cpp +++ b/src/yuzu/debugger/graphics/graphics_breakpoints.cpp | |||
| @@ -135,7 +135,7 @@ GraphicsBreakPointsWidget::GraphicsBreakPointsWidget( | |||
| 135 | std::shared_ptr<Tegra::DebugContext> debug_context, QWidget* parent) | 135 | std::shared_ptr<Tegra::DebugContext> debug_context, QWidget* parent) |
| 136 | : QDockWidget(tr("Maxwell Breakpoints"), parent), Tegra::DebugContext::BreakPointObserver( | 136 | : QDockWidget(tr("Maxwell Breakpoints"), parent), Tegra::DebugContext::BreakPointObserver( |
| 137 | debug_context) { | 137 | debug_context) { |
| 138 | setObjectName("TegraBreakPointsWidget"); | 138 | setObjectName(QStringLiteral("TegraBreakPointsWidget")); |
| 139 | 139 | ||
| 140 | status_text = new QLabel(tr("Emulation running")); | 140 | status_text = new QLabel(tr("Emulation running")); |
| 141 | resume_button = new QPushButton(tr("Resume")); | 141 | resume_button = new QPushButton(tr("Resume")); |
diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp index 86e03e46d..f594ef076 100644 --- a/src/yuzu/debugger/profiler.cpp +++ b/src/yuzu/debugger/profiler.cpp | |||
| @@ -47,7 +47,7 @@ private: | |||
| 47 | #endif | 47 | #endif |
| 48 | 48 | ||
| 49 | MicroProfileDialog::MicroProfileDialog(QWidget* parent) : QWidget(parent, Qt::Dialog) { | 49 | MicroProfileDialog::MicroProfileDialog(QWidget* parent) : QWidget(parent, Qt::Dialog) { |
| 50 | setObjectName("MicroProfile"); | 50 | setObjectName(QStringLiteral("MicroProfile")); |
| 51 | setWindowTitle(tr("MicroProfile")); | 51 | setWindowTitle(tr("MicroProfile")); |
| 52 | resize(1000, 600); | 52 | resize(1000, 600); |
| 53 | // Remove the "?" button from the titlebar and enable the maximize button | 53 | // Remove the "?" button from the titlebar and enable the maximize button |
| @@ -191,7 +191,7 @@ void MicroProfileDrawText(int x, int y, u32 hex_color, const char* text, u32 tex | |||
| 191 | for (u32 i = 0; i < text_length; ++i) { | 191 | for (u32 i = 0; i < text_length; ++i) { |
| 192 | // Position the text baseline 1 pixel above the bottom of the text cell, this gives nice | 192 | // Position the text baseline 1 pixel above the bottom of the text cell, this gives nice |
| 193 | // vertical alignment of text for a wide range of tested fonts. | 193 | // vertical alignment of text for a wide range of tested fonts. |
| 194 | mp_painter->drawText(x, y + MICROPROFILE_TEXT_HEIGHT - 2, QChar(text[i])); | 194 | mp_painter->drawText(x, y + MICROPROFILE_TEXT_HEIGHT - 2, QString{QLatin1Char{text[i]}}); |
| 195 | x += MICROPROFILE_TEXT_WIDTH + 1; | 195 | x += MICROPROFILE_TEXT_WIDTH + 1; |
| 196 | } | 196 | } |
| 197 | } | 197 | } |
diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp index 673aa8806..cd8180f8b 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 | |||
| 91 | WaitTreeMutexInfo::~WaitTreeMutexInfo() = default; | 91 | WaitTreeMutexInfo::~WaitTreeMutexInfo() = default; |
| 92 | 92 | ||
| 93 | QString WaitTreeMutexInfo::GetText() const { | 93 | QString 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 | ||
| 97 | std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeMutexInfo::GetChildren() const { | 97 | std::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 | ||
| 257 | QColor WaitTreeThread::GetColor() const { | 260 | QColor WaitTreeThread::GetColor() const { |
| @@ -424,7 +427,7 @@ void WaitTreeModel::InitItems() { | |||
| 424 | } | 427 | } |
| 425 | 428 | ||
| 426 | WaitTreeWidget::WaitTreeWidget(QWidget* parent) : QDockWidget(tr("Wait Tree"), parent) { | 429 | WaitTreeWidget::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); |