Qt: Fix race conditions initializing GDB stub

This commit is contained in:
Vicki Pfau 2019-06-27 17:56:09 -07:00
parent 1d17586cda
commit f6e5fb1375
4 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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);
}

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();