Qt: Update debugger portions to use threadInterrupt/threadContinue
Jeffrey Pfau jeffrey@endrift.com
Wed, 07 Jan 2015 02:05:52 -0800
2 files changed,
8 insertions(+),
12 deletions(-)
M
src/platform/qt/GDBController.cpp
→
src/platform/qt/GDBController.cpp
@@ -49,28 +49,25 @@ void GDBController::detach() {
if (!isAttached()) { return; } - bool wasPaused = m_gameController->isPaused(); disconnect(m_gameController, SIGNAL(frameAvailable(const uint32_t*)), this, SLOT(updateGDB())); - m_gameController->setPaused(true); + m_gameController->threadInterrupt(); GDBStubShutdown(&m_gdbStub); m_gameController->setDebugger(nullptr); - m_gameController->setPaused(wasPaused); + m_gameController->threadContinue(); } void GDBController::listen() { + m_gameController->threadInterrupt(); if (!isAttached()) { attach(); } - bool wasPaused = m_gameController->isPaused(); connect(m_gameController, SIGNAL(frameAvailable(const uint32_t*)), this, SLOT(updateGDB())); - m_gameController->setPaused(true); GDBStubListen(&m_gdbStub, m_port, m_bindAddress); - m_gameController->setPaused(wasPaused); + m_gameController->threadContinue(); } void GDBController::updateGDB() { - bool wasPaused = m_gameController->isPaused(); - m_gameController->setPaused(true); + m_gameController->threadInterrupt(); GDBStubUpdate(&m_gdbStub); - m_gameController->setPaused(wasPaused); + m_gameController->threadContinue(); }
M
src/platform/qt/GameController.cpp
→
src/platform/qt/GameController.cpp
@@ -146,8 +146,7 @@ return m_threadContext.debugger;
} void GameController::setDebugger(ARMDebugger* debugger) { - bool wasPaused = isPaused(); - setPaused(true); + threadInterrupt(); if (m_threadContext.debugger && GBAThreadHasStarted(&m_threadContext)) { GBADetachDebugger(m_threadContext.gba); }@@ -155,7 +154,7 @@ m_threadContext.debugger = debugger;
if (m_threadContext.debugger && GBAThreadHasStarted(&m_threadContext)) { GBAAttachDebugger(m_threadContext.gba, m_threadContext.debugger); } - setPaused(wasPaused); + threadContinue(); } #endif