Qt: Fix crash starting a GDB stub if a game isn't loaded

This commit is contained in:
Jeffrey Pfau 2015-02-20 00:23:03 -08:00
parent d983f31b38
commit 1994977c8f
2 changed files with 9 additions and 1 deletions

View File

@ -39,6 +39,7 @@ Bugfixes:
- GBA RR: Fix fallthrough error when reading tags from a movie
- GBA Thread: Fix possible deadlock in video sync
- GBA: Fix savestate loading of DISPSTAT and WAITCNT registers
- Qt: Fix crash starting a GDB stub if a game isn't loaded
Misc:
- GBA Audio: Change internal audio sample buffer from 32-bit to 16-bit samples
- GBA Memory: Simplify memory API and use fixed bus width

View File

@ -40,7 +40,14 @@ void GDBController::attach() {
return;
}
m_gameController->setDebugger(&m_gdbStub.d);
ARMDebuggerEnter(&m_gdbStub.d, DEBUGGER_ENTER_ATTACHED, 0);
if (m_gameController->isLoaded()) {
ARMDebuggerEnter(&m_gdbStub.d, DEBUGGER_ENTER_ATTACHED, 0);
} else {
connect(m_gameController, &GameController::gameStarted, [this] () {
disconnect(m_gameController);
ARMDebuggerEnter(&m_gdbStub.d, DEBUGGER_ENTER_ATTACHED, 0);
});
}
}
void GDBController::detach() {