all repos — mgba @ be82f04618980eccd0e0db656900b1840a4a99f0

mGBA Game Boy Advance Emulator

Print address alongside disassembled instructions
Jeffrey Pfau jeffrey@endrift.com
Fri, 10 Oct 2014 02:45:57 -0700
commit

be82f04618980eccd0e0db656900b1840a4a99f0

parent

6aee0693ec67d5234ad6426a7f12a7e81dcb5aca

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M src/debugger/cli-debugger.csrc/debugger/cli-debugger.c

@@ -233,16 +233,17 @@

static inline void _printLine(struct CLIDebugger* debugger, uint32_t address, enum ExecutionMode mode) { char disassembly[48]; struct ARMInstructionInfo info; + printf("%08X: ", address); if (mode == MODE_ARM) { uint32_t instruction = debugger->d.cpu->memory.load32(debugger->d.cpu, address, 0); ARMDecodeARM(instruction, &info); ARMDisassemble(&info, address + WORD_SIZE_ARM * 2, disassembly, sizeof(disassembly)); - printf("%08X: %s\n", instruction, disassembly); + printf("%08X\t%s\n", instruction, disassembly); } else { uint16_t instruction = debugger->d.cpu->memory.loadU16(debugger->d.cpu, address, 0); ARMDecodeThumb(instruction, &info); ARMDisassemble(&info, address + WORD_SIZE_THUMB * 2, disassembly, sizeof(disassembly)); - printf("%04X: %s\n", instruction, disassembly); + printf("%04X\t%s\n", instruction, disassembly); } }