Debugger: Clean up debugger interface, removing obsolete state (fixes #67)
Jeffrey Pfau jeffrey@endrift.com
Sun, 25 Jan 2015 13:28:14 -0800
5 files changed,
2 insertions(+),
14 deletions(-)
M
CHANGES
→
CHANGES
@@ -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.c
→
src/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.c
→
src/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.h
→
src/debugger/debugger.h
@@ -16,7 +16,6 @@ enum DebuggerState {
DEBUGGER_PAUSED, DEBUGGER_RUNNING, DEBUGGER_CUSTOM, - DEBUGGER_EXITING, DEBUGGER_SHUTDOWN };
M
src/gba/gba-thread.c
→
src/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);