From a6f895da7d1cc6a7664d7d0aba44c11921cf99f0 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 25 Dec 2014 02:37:26 -0800 Subject: [PATCH] Debugger: Align PC-relative loads in Thumb --- CHANGES | 1 + src/arm/decoder.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index fa1ba97e0..e54976c77 100644 --- a/CHANGES +++ b/CHANGES @@ -28,6 +28,7 @@ Bugfixes: - Video: Ensure FFmpeg encoder has audio frames - Video: Fix uncompressed PCM audio recording - GBA Video: Fix windows not disabling target 1 appropriately (fixes #161) + - Debugger: Align PC-relative loads in Thumb Misc: - Qt: Disable sync to video by default - GBA: Exit cleanly on FATAL if the port supports it diff --git a/src/arm/decoder.c b/src/arm/decoder.c index 3bf31ad7b..a5bece314 100644 --- a/src/arm/decoder.c +++ b/src/arm/decoder.c @@ -127,7 +127,7 @@ static int _decodeMemory(struct ARMMemoryAccess memory, int pc, char* buffer, in int written; if (memory.format & ARM_MEMORY_REGISTER_BASE) { if (memory.baseReg == ARM_PC && memory.format & ARM_MEMORY_IMMEDIATE_OFFSET) { - written = _decodePCRelative(memory.format & ARM_MEMORY_OFFSET_SUBTRACT ? -memory.offset.immediate : memory.offset.immediate, pc, buffer, blen); + written = _decodePCRelative(memory.format & ARM_MEMORY_OFFSET_SUBTRACT ? -memory.offset.immediate : memory.offset.immediate, pc & 0xFFFFFFFC, buffer, blen); ADVANCE(written); } else { written = _decodeRegister(memory.baseReg, buffer, blen);