mirror of https://github.com/mgba-emu/mgba.git
Debugger: Fix change watchpoints (fixes #1947)
This commit is contained in:
parent
19b77189c8
commit
1a694b0b56
1
CHANGES
1
CHANGES
|
@ -57,6 +57,7 @@ Other fixes:
|
||||||
- Core: Fix threading improperly setting paused state while interrupted
|
- Core: Fix threading improperly setting paused state while interrupted
|
||||||
- Debugger: Don't skip undefined instructions when debugger attached
|
- Debugger: Don't skip undefined instructions when debugger attached
|
||||||
- Debugger: Close trace log when done tracing
|
- Debugger: Close trace log when done tracing
|
||||||
|
- Debugger: Fix change watchpoints (fixes mgba.io/i/1947)
|
||||||
- FFmpeg: Fix some small memory leaks
|
- FFmpeg: Fix some small memory leaks
|
||||||
- FFmpeg: Fix encoding of time base
|
- FFmpeg: Fix encoding of time base
|
||||||
- GB Video: Fix SGB video logs
|
- GB Video: Fix SGB video logs
|
||||||
|
|
|
@ -38,7 +38,8 @@ enum mWatchpointType {
|
||||||
WATCHPOINT_WRITE = 1,
|
WATCHPOINT_WRITE = 1,
|
||||||
WATCHPOINT_READ = 2,
|
WATCHPOINT_READ = 2,
|
||||||
WATCHPOINT_RW = 3,
|
WATCHPOINT_RW = 3,
|
||||||
WATCHPOINT_WRITE_CHANGE = 4,
|
WATCHPOINT_CHANGE = 4,
|
||||||
|
WATCHPOINT_WRITE_CHANGE = 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum mBreakpointType {
|
enum mBreakpointType {
|
||||||
|
|
|
@ -106,17 +106,24 @@ static bool _checkWatchpoints(struct ARMDebugger* debugger, uint32_t address, st
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t oldValue;
|
||||||
switch (width + 1) {
|
switch (width + 1) {
|
||||||
case 1:
|
case 1:
|
||||||
info->type.wp.oldValue = debugger->originalMemory.load8(debugger->cpu, address, 0);
|
oldValue = debugger->originalMemory.load8(debugger->cpu, address, 0);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
info->type.wp.oldValue = debugger->originalMemory.load16(debugger->cpu, address, 0);
|
oldValue = debugger->originalMemory.load16(debugger->cpu, address, 0);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
info->type.wp.oldValue = debugger->originalMemory.load32(debugger->cpu, address, 0);
|
oldValue = debugger->originalMemory.load32(debugger->cpu, address, 0);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
if ((watchpoint->type & WATCHPOINT_CHANGE) && newValue == oldValue) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
info->type.wp.oldValue = oldValue;
|
||||||
info->type.wp.newValue = newValue;
|
info->type.wp.newValue = newValue;
|
||||||
info->address = address;
|
info->address = address;
|
||||||
info->type.wp.watchType = watchpoint->type;
|
info->type.wp.watchType = watchpoint->type;
|
||||||
|
|
|
@ -55,7 +55,11 @@ static bool _checkWatchpoints(struct SM83Debugger* debugger, uint16_t address, s
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
info->type.wp.oldValue = debugger->originalMemory.load8(debugger->cpu, address);
|
uint8_t oldValue = debugger->originalMemory.load8(debugger->cpu, address);
|
||||||
|
if ((watchpoint->type & WATCHPOINT_CHANGE) && newValue == oldValue) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
info->type.wp.oldValue = oldValue;
|
||||||
info->type.wp.newValue = newValue;
|
info->type.wp.newValue = newValue;
|
||||||
info->address = address;
|
info->address = address;
|
||||||
info->type.wp.watchType = watchpoint->type;
|
info->type.wp.watchType = watchpoint->type;
|
||||||
|
|
Loading…
Reference in New Issue