Fix debugging shim to work even if there is no GBA struct at the moment
Jeffrey Pfau jeffrey@endrift.com
Sat, 01 Feb 2014 16:27:27 -0800
1 files changed,
5 insertions(+),
2 deletions(-)
jump to
M
src/gba/gba.c
→
src/gba/gba.c
@@ -536,7 +536,10 @@ va_end(args);
} void GBADebuggerLogShim(struct ARMDebugger* debugger, enum DebuggerLogLevel level, const char* format, ...) { - struct GBABoard* gbaBoard = (struct GBABoard*) debugger->cpu->board; + struct GBABoard* gbaBoard = 0; + if (debugger->cpu && debugger->cpu->board) { + gbaBoard = (struct GBABoard*) debugger->cpu->board; + } enum GBALogLevel gbaLevel; switch (level) {@@ -555,7 +558,7 @@ break;
} va_list args; va_start(args, format); - _GBAVLog(gbaBoard->p, gbaLevel, format, args); + _GBAVLog(gbaBoard ? gbaBoard->p : 0, gbaLevel, format, args); va_end(args); }