all repos — mgba @ aa12eeef3a8ea3eaed3d6d863b9f5cdbc4b0a8f1

mGBA Game Boy Advance Emulator

Qt: Update debugger portions to use threadInterrupt/threadContinue
Jeffrey Pfau jeffrey@endrift.com
Wed, 07 Jan 2015 02:05:52 -0800
commit

aa12eeef3a8ea3eaed3d6d863b9f5cdbc4b0a8f1

parent

7a7dcea212a3468cf2d6fca6fe973955f1039a2a

2 files changed, 8 insertions(+), 12 deletions(-)

jump to
M src/platform/qt/GDBController.cppsrc/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.cppsrc/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