ARM Debugger: Clear low bit on breakpoint addresses (fixes #1764)

This commit is contained in:
Vicki Pfau 2020-05-25 00:58:09 -07:00
parent ff4406fab0
commit ff1033b801
2 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,7 @@ Emulation fixes:
- GBA Video: Fix disabling OBJWIN in GL renderer (fixes mgba.io/i/1759)
Other fixes:
- All: Improve export headers (fixes mgba.io/i/1738)
- ARM Debugger: Clear low bit on breakpoint addresses (fixes mgba.io/i/1764)
- CMake: Always use devkitPro toolchain when applicable (fixes mgba.io/i/1755)
- Core: Ensure ELF regions can be written before trying
- Core: Fix ELF loading regression (fixes mgba.io/i/1669)

View File

@ -171,7 +171,7 @@ ssize_t ARMDebuggerSetSoftwareBreakpoint(struct mDebuggerPlatform* d, uint32_t a
ssize_t id = debugger->nextId;
++debugger->nextId;
breakpoint->d.id = id;
breakpoint->d.address = address;
breakpoint->d.address = address & ~1; // Clear Thumb bit since it's not part of a valid address
breakpoint->d.segment = -1;
breakpoint->d.condition = NULL;
breakpoint->d.type = BREAKPOINT_SOFTWARE;
@ -187,6 +187,7 @@ static ssize_t ARMDebuggerSetBreakpoint(struct mDebuggerPlatform* d, const struc
ssize_t id = debugger->nextId;
++debugger->nextId;
breakpoint->d = *info;
breakpoint->d.address &= ~1; // Clear Thumb bit since it's not part of a valid address
breakpoint->d.id = id;
if (info->type == BREAKPOINT_SOFTWARE) {
// TODO