Qt: Fix race conditions initializing GDB stub

This commit is contained in:
Vicki Pfau 2019-06-27 17:56:09 -07:00
parent 4731bae9e0
commit 2420fd81e7
4 changed files with 5 additions and 4 deletions

View File

@ -42,6 +42,7 @@ Other fixes:
- GBA Cheats: Fix PARv3 Thumb hooks
- mGUI: Fix crash if last loaded ROM directory disappears (fixes mgba.io/i/1466)
- Libretro: Fix crash changing allowing opposing directions (hhromic)
- Qt: Fix race conditions initializing GDB stub
Misc:
- GBA Savedata: EEPROM performance fixes
- GBA Savedata: Automatically map 1Mbit Flash files as 1Mbit Flash

View File

@ -275,6 +275,7 @@ void CoreController::setDebugger(mDebugger* debugger) {
Interrupter interrupter(this);
if (debugger) {
mDebuggerAttach(debugger, m_threadContext.core);
mDebuggerEnter(debugger, DEBUGGER_ENTER_ATTACHED, 0);
} else {
m_threadContext.core->detachDebugger(m_threadContext.core);
}

View File

@ -46,7 +46,6 @@ void DebuggerController::attach() {
if (m_gameController) {
attachInternal();
m_gameController->setDebugger(m_debugger);
mDebuggerEnter(m_debugger, DEBUGGER_ENTER_ATTACHED, 0);
} else {
m_autoattach = true;
}

View File

@ -34,10 +34,10 @@ void GDBController::setBindAddress(uint32_t bindAddress) {
}
void GDBController::listen() {
if (!isAttached()) {
attach();
}
if (GDBStubListen(&m_gdbStub, m_port, &m_bindAddress)) {
if (!isAttached()) {
attach();
}
emit listening();
} else {
detach();