diff --git a/CHANGES b/CHANGES index 638a6b422..c332c5594 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,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: - Qt: Make mute menu option also toggle fast-forward mute (fixes mgba.io/i/1424) - Qt: Show error message if file failed to load diff --git a/src/platform/qt/CoreController.cpp b/src/platform/qt/CoreController.cpp index 05c090ad9..e53ec1c8d 100644 --- a/src/platform/qt/CoreController.cpp +++ b/src/platform/qt/CoreController.cpp @@ -261,6 +261,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); } diff --git a/src/platform/qt/DebuggerController.cpp b/src/platform/qt/DebuggerController.cpp index f6c7fdd36..7291b62fa 100644 --- a/src/platform/qt/DebuggerController.cpp +++ b/src/platform/qt/DebuggerController.cpp @@ -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; } diff --git a/src/platform/qt/GDBController.cpp b/src/platform/qt/GDBController.cpp index d2e9523b7..32edc7d14 100644 --- a/src/platform/qt/GDBController.cpp +++ b/src/platform/qt/GDBController.cpp @@ -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();