diff options
| author | 2014-07-23 00:58:52 +0200 | |
|---|---|---|
| committer | 2014-07-23 00:58:52 +0200 | |
| commit | c131fb2c279f702c3b7cf2026cbff366c03fc767 (patch) | |
| tree | 0ecee8655053b792d703991797e98ba92f6e94b0 /src/citra_qt/debugger/disassembler.cpp | |
| parent | Disassembler: Chose slightly lower value for chunk size. (diff) | |
| download | yuzu-c131fb2c279f702c3b7cf2026cbff366c03fc767.tar.gz yuzu-c131fb2c279f702c3b7cf2026cbff366c03fc767.tar.xz yuzu-c131fb2c279f702c3b7cf2026cbff366c03fc767.zip | |
citra-qt: Show function names in disassembler based on bunnei's suggestion.
Diffstat (limited to 'src/citra_qt/debugger/disassembler.cpp')
| -rw-r--r-- | src/citra_qt/debugger/disassembler.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp index 617a8860b..507a35718 100644 --- a/src/citra_qt/debugger/disassembler.cpp +++ b/src/citra_qt/debugger/disassembler.cpp | |||
| @@ -39,16 +39,32 @@ QVariant DisassemblerModel::data(const QModelIndex& index, int role) const { | |||
| 39 | static char result[255]; | 39 | static char result[255]; |
| 40 | 40 | ||
| 41 | u32 address = base_address + index.row() * 4; | 41 | u32 address = base_address + index.row() * 4; |
| 42 | ARM_Disasm::disasm(address, Memory::Read32(address), result); | 42 | u32 instr = Memory::Read32(address); |
| 43 | ARM_Disasm::disasm(address, instr, result); | ||
| 43 | 44 | ||
| 44 | if (index.column() == 0) { | 45 | if (index.column() == 0) { |
| 45 | return QString("0x%1").arg((uint)(address), 8, 16, QLatin1Char('0')); | 46 | return QString("0x%1").arg((uint)(address), 8, 16, QLatin1Char('0')); |
| 46 | } else if (index.column() == 1) { | 47 | } else if (index.column() == 1) { |
| 47 | return QString::fromLatin1(result); | 48 | return QString::fromLatin1(result); |
| 48 | } else if (index.column() == 2 && Symbols::HasSymbol(address)) { | 49 | } else if (index.column() == 2) { |
| 49 | TSymbol symbol = Symbols::GetSymbol(address); | 50 | if(Symbols::HasSymbol(address)) { |
| 50 | return QString("%1 - Size:%2").arg(QString::fromStdString(symbol.name)) | 51 | TSymbol symbol = Symbols::GetSymbol(address); |
| 51 | .arg(symbol.size / 4); // divide by 4 to get instruction count | 52 | return QString("%1 - Size:%2").arg(QString::fromStdString(symbol.name)) |
| 53 | .arg(symbol.size / 4); // divide by 4 to get instruction count | ||
| 54 | } else if (ARM_Disasm::decode(instr) == OP_BL) { | ||
| 55 | u32 offset = instr & 0xFFFFFF; | ||
| 56 | |||
| 57 | // Sign-extend the 24-bit offset | ||
| 58 | if ((offset >> 23) & 1) | ||
| 59 | offset |= 0xFF000000; | ||
| 60 | |||
| 61 | // Pre-compute the left-shift and the prefetch offset | ||
| 62 | offset <<= 2; | ||
| 63 | offset += 8; | ||
| 64 | |||
| 65 | TSymbol symbol = Symbols::GetSymbol(address + offset); | ||
| 66 | return QString(" --> %1").arg(QString::fromStdString(symbol.name)); | ||
| 67 | } | ||
| 52 | } | 68 | } |
| 53 | 69 | ||
| 54 | break; | 70 | break; |