all repos — mgba @ 5e02cbd6f3701b111d3fc09ce0082cc9ce4927df

mGBA Game Boy Advance Emulator

Debugger: Turn off watchpoints if they aren't supported
Jeffrey Pfau jeffrey@endrift.com
Fri, 16 Sep 2016 11:47:12 -0700
commit

5e02cbd6f3701b111d3fc09ce0082cc9ce4927df

parent

4ea859af01d6bf244698cddc2fa7529a10a25da8

1 files changed, 7 insertions(+), 1 deletions(-)

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

@@ -378,6 +378,10 @@ if (!dv || dv->type != CLIDV_INT_TYPE) {

printf("%s\n", ERROR_MISSING_ARGS); return; } + if (!debugger->d.platform->setWatchpoint) { + printf("Watchpoints are not supported by this platform.\n"); + return; + } uint32_t address = dv->intValue; debugger->d.platform->setWatchpoint(debugger->d.platform, address, WATCHPOINT_RW); // TODO: ro/wo }

@@ -389,7 +393,9 @@ return;

} uint32_t address = dv->intValue; debugger->d.platform->clearBreakpoint(debugger->d.platform, address); - debugger->d.platform->clearWatchpoint(debugger->d.platform, address); + if (debugger->d.platform->clearWatchpoint) { + debugger->d.platform->clearWatchpoint(debugger->d.platform, address); + } } static void _breakIntoDefault(int signal) {