From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/citra_qt/debugger/callstack.cpp | 41 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'src/citra_qt/debugger/callstack.cpp') diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp index 1a3077495..a87046acb 100644 --- a/src/citra_qt/debugger/callstack.cpp +++ b/src/citra_qt/debugger/callstack.cpp @@ -9,13 +9,12 @@ #include "common/common_types.h" #include "common/symbols.h" -#include "core/core.h" -#include "core/memory.h" #include "core/arm/arm_interface.h" #include "core/arm/disassembler/arm_disasm.h" +#include "core/core.h" +#include "core/memory.h" -CallstackWidget::CallstackWidget(QWidget* parent): QDockWidget(parent) -{ +CallstackWidget::CallstackWidget(QWidget* parent) : QDockWidget(parent) { ui.setupUi(this); callstack_model = new QStandardItemModel(this); @@ -27,29 +26,26 @@ CallstackWidget::CallstackWidget(QWidget* parent): QDockWidget(parent) ui.treeView->setModel(callstack_model); } -void CallstackWidget::OnDebugModeEntered() -{ +void CallstackWidget::OnDebugModeEntered() { // Stack pointer const u32 sp = Core::g_app_core->GetReg(13); Clear(); int counter = 0; - for (u32 addr = 0x10000000; addr >= sp; addr -= 4) - { + for (u32 addr = 0x10000000; addr >= sp; addr -= 4) { if (!Memory::IsValidVirtualAddress(addr)) break; const u32 ret_addr = Memory::Read32(addr); - const u32 call_addr = ret_addr - 4; //get call address??? + const u32 call_addr = ret_addr - 4; // get call address??? if (!Memory::IsValidVirtualAddress(call_addr)) break; /* TODO (mattvail) clean me, move to debugger interface */ u32 insn = Memory::Read32(call_addr); - if (ARM_Disasm::Decode(insn) == OP_BL) - { + if (ARM_Disasm::Decode(insn) == OP_BL) { std::string name; // ripped from disasm u8 cond = (insn >> 28) & 0xf; @@ -63,26 +59,29 @@ void CallstackWidget::OnDebugModeEntered() i_offset += 8; const u32 func_addr = call_addr + i_offset; - callstack_model->setItem(counter, 0, new QStandardItem(QString("0x%1").arg(addr, 8, 16, QLatin1Char('0')))); - callstack_model->setItem(counter, 1, new QStandardItem(QString("0x%1").arg(ret_addr, 8, 16, QLatin1Char('0')))); - callstack_model->setItem(counter, 2, new QStandardItem(QString("0x%1").arg(call_addr, 8, 16, QLatin1Char('0')))); + callstack_model->setItem( + counter, 0, new QStandardItem(QString("0x%1").arg(addr, 8, 16, QLatin1Char('0')))); + callstack_model->setItem(counter, 1, new QStandardItem(QString("0x%1").arg( + ret_addr, 8, 16, QLatin1Char('0')))); + callstack_model->setItem(counter, 2, new QStandardItem(QString("0x%1").arg( + call_addr, 8, 16, QLatin1Char('0')))); name = Symbols::HasSymbol(func_addr) ? Symbols::GetSymbol(func_addr).name : "unknown"; - callstack_model->setItem(counter, 3, new QStandardItem(QString("%1_%2").arg(QString::fromStdString(name)) - .arg(QString("0x%1").arg(func_addr, 8, 16, QLatin1Char('0'))))); + callstack_model->setItem( + counter, 3, new QStandardItem( + QString("%1_%2") + .arg(QString::fromStdString(name)) + .arg(QString("0x%1").arg(func_addr, 8, 16, QLatin1Char('0'))))); counter++; } } } -void CallstackWidget::OnDebugModeLeft() -{ - +void CallstackWidget::OnDebugModeLeft() { } -void CallstackWidget::Clear() -{ +void CallstackWidget::Clear() { for (int row = 0; row < callstack_model->rowCount(); row++) { for (int column = 0; column < callstack_model->columnCount(); column++) { callstack_model->setItem(row, column, new QStandardItem()); -- cgit v1.2.3 From 396a8d91a4423d9c793eeff0798d544613647511 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sun, 18 Sep 2016 18:01:46 -0700 Subject: Manually tweak source formatting and then re-run clang-format --- src/citra_qt/debugger/callstack.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/citra_qt/debugger/callstack.cpp') diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp index a87046acb..db266b506 100644 --- a/src/citra_qt/debugger/callstack.cpp +++ b/src/citra_qt/debugger/callstack.cpp @@ -78,8 +78,7 @@ void CallstackWidget::OnDebugModeEntered() { } } -void CallstackWidget::OnDebugModeLeft() { -} +void CallstackWidget::OnDebugModeLeft() {} void CallstackWidget::Clear() { for (int row = 0; row < callstack_model->rowCount(); row++) { -- cgit v1.2.3 From ebdae19fd226104baec712b9da9939ff82ef3c3a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 21 Sep 2016 00:21:23 +0900 Subject: Remove empty newlines in #include blocks. This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation. --- src/citra_qt/debugger/callstack.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/citra_qt/debugger/callstack.cpp') diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp index db266b506..14bd1c77c 100644 --- a/src/citra_qt/debugger/callstack.cpp +++ b/src/citra_qt/debugger/callstack.cpp @@ -2,13 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include - #include "citra_qt/debugger/callstack.h" - +#include #include "common/common_types.h" #include "common/symbols.h" - #include "core/arm/arm_interface.h" #include "core/arm/disassembler/arm_disasm.h" #include "core/core.h" -- cgit v1.2.3 From 84fbbe26297652d994d203bde543ec252c2d801a Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Tue, 20 Sep 2016 23:52:38 -0700 Subject: Use negative priorities to avoid special-casing the self-include --- src/citra_qt/debugger/callstack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/citra_qt/debugger/callstack.cpp') diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp index 14bd1c77c..c66f2b96a 100644 --- a/src/citra_qt/debugger/callstack.cpp +++ b/src/citra_qt/debugger/callstack.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/callstack.h" #include +#include "citra_qt/debugger/callstack.h" #include "common/common_types.h" #include "common/symbols.h" #include "core/arm/arm_interface.h" -- cgit v1.2.3