mirror of https://github.com/mgba-emu/mgba.git
Test: Allow ROM tester to be debugged
This commit is contained in:
parent
569bc92b90
commit
63b18687f0
|
@ -139,6 +139,19 @@ int main(int argc, char * argv[]) {
|
||||||
goto loadError;
|
goto loadError;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_DEBUGGERS
|
||||||
|
struct mDebugger debugger;
|
||||||
|
mDebuggerInit(&debugger);
|
||||||
|
bool hasDebugger = mArgumentsApplyDebugger(&args, core, &debugger);
|
||||||
|
|
||||||
|
if (hasDebugger) {
|
||||||
|
mDebuggerAttach(&debugger, core);
|
||||||
|
mDebuggerEnter(&debugger, DEBUGGER_ENTER_MANUAL, NULL);
|
||||||
|
} else {
|
||||||
|
mDebuggerDeinit(&debugger);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
core->reset(core);
|
core->reset(core);
|
||||||
|
|
||||||
mArgumentsApplyFileLoads(&args, core);
|
mArgumentsApplyFileLoads(&args, core);
|
||||||
|
@ -152,11 +165,25 @@ int main(int argc, char * argv[]) {
|
||||||
savestate->close(savestate);
|
savestate->close(savestate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_DEBUGGERS
|
||||||
|
if (hasDebugger) {
|
||||||
|
do {
|
||||||
|
mDebuggerRun(&debugger);
|
||||||
|
} while (!_dispatchExiting && debugger.state != DEBUGGER_SHUTDOWN);
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
do {
|
do {
|
||||||
core->runLoop(core);
|
core->runLoop(core);
|
||||||
} while (!_dispatchExiting);
|
} while (!_dispatchExiting);
|
||||||
|
|
||||||
core->unloadROM(core);
|
core->unloadROM(core);
|
||||||
|
|
||||||
|
#ifdef USE_DEBUGGERS
|
||||||
|
if (hasDebugger) {
|
||||||
|
core->detachDebugger(core);
|
||||||
|
mDebuggerDeinit(&debugger);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
cleanExit = true;
|
cleanExit = true;
|
||||||
|
|
||||||
loadError:
|
loadError:
|
||||||
|
|
Loading…
Reference in New Issue