Skip to content

Commit

Permalink
Show symbols in disasm
Browse files Browse the repository at this point in the history
  • Loading branch information
mattvail committed Apr 12, 2014
1 parent 67095f8 commit 0ecb036
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/citra_qt/disasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "core/core.h"
#include "common/break_points.h"
#include "common/symbols.h"
#include "core/arm/interpreter/armdefs.h"
#include "core/arm/disassembler/arm_disasm.h"

Expand All @@ -20,7 +21,7 @@ GDisAsmView::GDisAsmView(QWidget* parent, EmuThread& emu_thread) : QDockWidget(p
breakpoints = new BreakPoints();

model = new QStandardItemModel(this);
model->setColumnCount(2);
model->setColumnCount(3);
disasm_ui.treeView->setModel(model);

RegisterHotkey("Disassembler", "Start/Stop", QKeySequence(Qt::Key_F5), Qt::ApplicationShortcut);
Expand Down Expand Up @@ -52,6 +53,13 @@ void GDisAsmView::Init()
disasm->disasm(curInstAddr, Memory::Read32(curInstAddr), result);
model->setItem(i, 0, new QStandardItem(QString("0x%1").arg((uint)(curInstAddr), 8, 16, QLatin1Char('0'))));
model->setItem(i, 1, new QStandardItem(QString(result)));
if (Symbols::HasSymbol(curInstAddr))
{
TSymbol symbol = Symbols::GetSymbol(curInstAddr);
model->setItem(i, 2, new QStandardItem(QString("%1 - Size:%2").arg(QString::fromStdString(symbol.name))
.arg(symbol.size / 4))); // divide by 4 to get instruction count

}
curInstAddr += 4;
}
disasm_ui.treeView->resizeColumnToContents(0);
Expand Down

0 comments on commit 0ecb036

Please sign in to comment.