all repos — mgba @ f4fcdf35d4d88616a3bda9bce7384df0e83a6964

mGBA Game Boy Advance Emulator

Debugger: Clean up debugger interface, removing obsolete state (fixes #67)
Jeffrey Pfau jeffrey@endrift.com
Sun, 25 Jan 2015 13:28:14 -0800
commit

f4fcdf35d4d88616a3bda9bce7384df0e83a6964

parent

eb4c41d6fc8ab1ed16e9812e4f54a1de93d6cc3c

M CHANGESCHANGES

@@ -40,6 +40,7 @@ - GBA: Improve accuracy of event timing

- Debugger: Clean up GDB stub network interfacing - Debugger: Simplify debugger state machine to play nicer with the GBA thread loop - Debugger: Merge Thumb BL instructions when disassembling + - Debugger: Clean up debugger interface, removing obsolete state (fixes #67) 0.1.1: (2015-01-24) Bugfixes:
M src/debugger/cli-debugger.csrc/debugger/cli-debugger.c

@@ -640,7 +640,6 @@ HistEvent ev;

while (debugger->state == DEBUGGER_PAUSED) { line = el_gets(cliDebugger->elstate, &count); if (!line) { - debugger->state = DEBUGGER_EXITING; return; } if (line[0] == '\n') {
M src/debugger/debugger.csrc/debugger/debugger.c

@@ -56,9 +56,6 @@ }

void ARMDebuggerRun(struct ARMDebugger* debugger) { switch (debugger->state) { - case DEBUGGER_EXITING: - debugger->state = DEBUGGER_RUNNING; - // Fall through case DEBUGGER_RUNNING: if (!debugger->breakpoints && !debugger->watchpoints) { ARMRunLoop(debugger->cpu);
M src/debugger/debugger.hsrc/debugger/debugger.h

@@ -16,7 +16,6 @@ enum DebuggerState {

DEBUGGER_PAUSED, DEBUGGER_RUNNING, DEBUGGER_CUSTOM, - DEBUGGER_EXITING, DEBUGGER_SHUTDOWN };
M src/gba/gba-thread.csrc/gba/gba-thread.c

@@ -77,9 +77,6 @@ }

} static void _pauseThread(struct GBAThread* threadContext, bool onThread) { - if (threadContext->debugger && threadContext->debugger->state == DEBUGGER_RUNNING) { - threadContext->debugger->state = DEBUGGER_EXITING; - } threadContext->state = THREAD_PAUSING; if (!onThread) { _waitUntilNotState(threadContext, THREAD_PAUSING);

@@ -392,9 +389,7 @@ }

void GBAThreadEnd(struct GBAThread* threadContext) { MutexLock(&threadContext->stateMutex); - if (threadContext->debugger && threadContext->debugger->state == DEBUGGER_RUNNING) { - threadContext->debugger->state = DEBUGGER_EXITING; - } + _waitOnInterrupt(threadContext); threadContext->state = THREAD_EXITING; if (threadContext->gba) { threadContext->gba->cpu->halted = false;

@@ -495,9 +490,6 @@ threadContext->savedState = threadContext->state;

_waitOnInterrupt(threadContext); threadContext->state = THREAD_INTERRUPTING; threadContext->gba->cpu->nextEvent = 0; - if (threadContext->debugger && threadContext->debugger->state == DEBUGGER_RUNNING) { - threadContext->debugger->state = DEBUGGER_EXITING; - } ConditionWake(&threadContext->stateCond); _waitUntilNotState(threadContext, THREAD_INTERRUPTING); MutexUnlock(&threadContext->stateMutex);