diff options
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 507a35718..856baf63d 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 { | |||
| 36 | switch (role) { | 36 | switch (role) { |
| 37 | case Qt::DisplayRole: | 37 | case Qt::DisplayRole: |
| 38 | { | 38 | { |
| 39 | static char result[255]; | ||
| 40 | |||
| 41 | u32 address = base_address + index.row() * 4; | 39 | u32 address = base_address + index.row() * 4; |
| 42 | u32 instr = Memory::Read32(address); | 40 | u32 instr = Memory::Read32(address); |
| 43 | ARM_Disasm::disasm(address, instr, result); | 41 | std::string disassembly = ARM_Disasm::Disassemble(address, instr); |
| 44 | 42 | ||
| 45 | if (index.column() == 0) { | 43 | if (index.column() == 0) { |
| 46 | return QString("0x%1").arg((uint)(address), 8, 16, QLatin1Char('0')); | 44 | return QString("0x%1").arg((uint)(address), 8, 16, QLatin1Char('0')); |
| 47 | } else if (index.column() == 1) { | 45 | } else if (index.column() == 1) { |
| 48 | return QString::fromLatin1(result); | 46 | return QString::fromStdString(disassembly); |
| 49 | } else if (index.column() == 2) { | 47 | } else if (index.column() == 2) { |
| 50 | if(Symbols::HasSymbol(address)) { | 48 | if(Symbols::HasSymbol(address)) { |
| 51 | TSymbol symbol = Symbols::GetSymbol(address); | 49 | TSymbol symbol = Symbols::GetSymbol(address); |
| 52 | return QString("%1 - Size:%2").arg(QString::fromStdString(symbol.name)) | 50 | return QString("%1 - Size:%2").arg(QString::fromStdString(symbol.name)) |
| 53 | .arg(symbol.size / 4); // divide by 4 to get instruction count | 51 | .arg(symbol.size / 4); // divide by 4 to get instruction count |
| 54 | } else if (ARM_Disasm::decode(instr) == OP_BL) { | 52 | } else if (ARM_Disasm::Decode(instr) == OP_BL) { |
| 55 | u32 offset = instr & 0xFFFFFF; | 53 | u32 offset = instr & 0xFFFFFF; |
| 56 | 54 | ||
| 57 | // Sign-extend the 24-bit offset | 55 | // Sign-extend the 24-bit offset |