ARM Debugger: Fix disassembly alignment (fixes #2204)

This commit is contained in:
Vicki Pfau 2021-06-04 21:01:07 -07:00
parent 38d55d9b6d
commit e17357a50a
2 changed files with 3 additions and 1 deletions

View File

@ -11,6 +11,7 @@ Emulation fixes:
- GBA Video: Revert scanline latching changes (fixes mgba.io/i/2153, mgba.io/i/2149) - GBA Video: Revert scanline latching changes (fixes mgba.io/i/2153, mgba.io/i/2149)
Other fixes: Other fixes:
- 3DS: Fix disabling "wide" mode on 2DS (fixes mgba.io/i/2167) - 3DS: Fix disabling "wide" mode on 2DS (fixes mgba.io/i/2167)
- ARM Debugger: Fix disassembly alignment (fixes mgba.io/i/2204)
- Core: Fix memory leak in opening games from the library - Core: Fix memory leak in opening games from the library
- Core: Fix memory searches for relative values (fixes mgba.io/i/2135) - Core: Fix memory searches for relative values (fixes mgba.io/i/2135)
- GB Core: Fix GBC colors setting breaking default model overrides (fixes mgba.io/i/2161) - GB Core: Fix GBC colors setting breaking default model overrides (fixes mgba.io/i/2161)

View File

@ -101,9 +101,10 @@ static inline uint32_t _printLine(struct CLIDebugger* debugger, uint32_t address
struct mCore* core = debugger->d.core; struct mCore* core = debugger->d.core;
char disassembly[64]; char disassembly[64];
struct ARMInstructionInfo info; struct ARMInstructionInfo info;
address &= ~(WORD_SIZE_THUMB - 1);
be->printf(be, "%08X: ", address); be->printf(be, "%08X: ", address);
if (mode == MODE_ARM) { if (mode == MODE_ARM) {
uint32_t instruction = core->busRead32(core, address); uint32_t instruction = core->busRead32(core, address & ~(WORD_SIZE_ARM - 1));
ARMDecodeARM(instruction, &info); ARMDecodeARM(instruction, &info);
ARMDisassemble(&info, core->cpu, core->symbolTable, address + WORD_SIZE_ARM * 2, disassembly, sizeof(disassembly)); ARMDisassemble(&info, core->cpu, core->symbolTable, address + WORD_SIZE_ARM * 2, disassembly, sizeof(disassembly));
be->printf(be, "%08X\t%s\n", instruction, disassembly); be->printf(be, "%08X\t%s\n", instruction, disassembly);