mirror of https://github.com/mgba-emu/mgba.git
Qt: Update debugger portions to use threadInterrupt/threadContinue
This commit is contained in:
parent
7a7dcea212
commit
aa12eeef3a
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -146,8 +146,7 @@ ARMDebugger* GameController::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 @@ void GameController::setDebugger(ARMDebugger* debugger) {
|
|||
if (m_threadContext.debugger && GBAThreadHasStarted(&m_threadContext)) {
|
||||
GBAAttachDebugger(m_threadContext.gba, m_threadContext.debugger);
|
||||
}
|
||||
setPaused(wasPaused);
|
||||
threadContinue();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue