diff options
author | bunnei <bunneidev@gmail.com> | 2014-09-08 00:10:13 -0400 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-09-08 00:10:13 -0400 |
commit | 335082e74e5f015450f1ad57cb90d1f8fd4afbdb (patch) | |
tree | 576c57f45d933885d31f7eddfbf85167bc1b88ac /src/citra_qt/debugger/disassembler.cpp | |
parent | 85f1b76cd8a223968d61fbd93235acee5dcab47e (diff) | |
parent | 403c84cdabe0eab9b2ec1a1effdb9beac5d09853 (diff) |
Merge pull request #95 from lioncash/disassembler
core: Make the ARM disassembler use std::string internally
Diffstat (limited to 'src/citra_qt/debugger/disassembler.cpp')
-rw-r--r-- | src/citra_qt/debugger/disassembler.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp index 507a357181..856baf63dc 100644 --- a/src/citra_qt/debugger/disassembler.cpp +++ b/src/citra_qt/debugger/disassembler.cpp @@ -36,22 +36,20 @@ QVariant DisassemblerModel::data(const QModelIndex& index, int role) const { switch (role) { case Qt::DisplayRole: { - static char result[255]; - u32 address = base_address + index.row() * 4; u32 instr = Memory::Read32(address); - ARM_Disasm::disasm(address, instr, result); + std::string disassembly = ARM_Disasm::Disassemble(address, instr); if (index.column() == 0) { return QString("0x%1").arg((uint)(address), 8, 16, QLatin1Char('0')); } else if (index.column() == 1) { - return QString::fromLatin1(result); + return QString::fromStdString(disassembly); } else if (index.column() == 2) { if(Symbols::HasSymbol(address)) { TSymbol symbol = Symbols::GetSymbol(address); return QString("%1 - Size:%2").arg(QString::fromStdString(symbol.name)) .arg(symbol.size / 4); // divide by 4 to get instruction count - } else if (ARM_Disasm::decode(instr) == OP_BL) { + } else if (ARM_Disasm::Decode(instr) == OP_BL) { u32 offset = instr & 0xFFFFFF; // Sign-extend the 24-bit offset |