mirror of https://github.com/mgba-emu/mgba.git
Debugger: Clean up debugger interface, removing obsolete state (fixes #67)
This commit is contained in:
parent
eb4c41d6fc
commit
f4fcdf35d4
1
CHANGES
1
CHANGES
|
@ -40,6 +40,7 @@ Misc:
|
||||||
- Debugger: Clean up GDB stub network interfacing
|
- Debugger: Clean up GDB stub network interfacing
|
||||||
- Debugger: Simplify debugger state machine to play nicer with the GBA thread loop
|
- Debugger: Simplify debugger state machine to play nicer with the GBA thread loop
|
||||||
- Debugger: Merge Thumb BL instructions when disassembling
|
- Debugger: Merge Thumb BL instructions when disassembling
|
||||||
|
- Debugger: Clean up debugger interface, removing obsolete state (fixes #67)
|
||||||
|
|
||||||
0.1.1: (2015-01-24)
|
0.1.1: (2015-01-24)
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|
|
@ -640,7 +640,6 @@ static void _commandLine(struct ARMDebugger* debugger) {
|
||||||
while (debugger->state == DEBUGGER_PAUSED) {
|
while (debugger->state == DEBUGGER_PAUSED) {
|
||||||
line = el_gets(cliDebugger->elstate, &count);
|
line = el_gets(cliDebugger->elstate, &count);
|
||||||
if (!line) {
|
if (!line) {
|
||||||
debugger->state = DEBUGGER_EXITING;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (line[0] == '\n') {
|
if (line[0] == '\n') {
|
||||||
|
|
|
@ -56,9 +56,6 @@ void ARMDebuggerDeinit(struct ARMComponent* component) {
|
||||||
|
|
||||||
void ARMDebuggerRun(struct ARMDebugger* debugger) {
|
void ARMDebuggerRun(struct ARMDebugger* debugger) {
|
||||||
switch (debugger->state) {
|
switch (debugger->state) {
|
||||||
case DEBUGGER_EXITING:
|
|
||||||
debugger->state = DEBUGGER_RUNNING;
|
|
||||||
// Fall through
|
|
||||||
case DEBUGGER_RUNNING:
|
case DEBUGGER_RUNNING:
|
||||||
if (!debugger->breakpoints && !debugger->watchpoints) {
|
if (!debugger->breakpoints && !debugger->watchpoints) {
|
||||||
ARMRunLoop(debugger->cpu);
|
ARMRunLoop(debugger->cpu);
|
||||||
|
|
|
@ -16,7 +16,6 @@ enum DebuggerState {
|
||||||
DEBUGGER_PAUSED,
|
DEBUGGER_PAUSED,
|
||||||
DEBUGGER_RUNNING,
|
DEBUGGER_RUNNING,
|
||||||
DEBUGGER_CUSTOM,
|
DEBUGGER_CUSTOM,
|
||||||
DEBUGGER_EXITING,
|
|
||||||
DEBUGGER_SHUTDOWN
|
DEBUGGER_SHUTDOWN
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -77,9 +77,6 @@ static void _waitUntilNotState(struct GBAThread* threadContext, enum ThreadState
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _pauseThread(struct GBAThread* threadContext, bool onThread) {
|
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;
|
threadContext->state = THREAD_PAUSING;
|
||||||
if (!onThread) {
|
if (!onThread) {
|
||||||
_waitUntilNotState(threadContext, THREAD_PAUSING);
|
_waitUntilNotState(threadContext, THREAD_PAUSING);
|
||||||
|
@ -392,9 +389,7 @@ bool GBAThreadHasCrashed(struct GBAThread* threadContext) {
|
||||||
|
|
||||||
void GBAThreadEnd(struct GBAThread* threadContext) {
|
void GBAThreadEnd(struct GBAThread* threadContext) {
|
||||||
MutexLock(&threadContext->stateMutex);
|
MutexLock(&threadContext->stateMutex);
|
||||||
if (threadContext->debugger && threadContext->debugger->state == DEBUGGER_RUNNING) {
|
_waitOnInterrupt(threadContext);
|
||||||
threadContext->debugger->state = DEBUGGER_EXITING;
|
|
||||||
}
|
|
||||||
threadContext->state = THREAD_EXITING;
|
threadContext->state = THREAD_EXITING;
|
||||||
if (threadContext->gba) {
|
if (threadContext->gba) {
|
||||||
threadContext->gba->cpu->halted = false;
|
threadContext->gba->cpu->halted = false;
|
||||||
|
@ -495,9 +490,6 @@ void GBAThreadInterrupt(struct GBAThread* threadContext) {
|
||||||
_waitOnInterrupt(threadContext);
|
_waitOnInterrupt(threadContext);
|
||||||
threadContext->state = THREAD_INTERRUPTING;
|
threadContext->state = THREAD_INTERRUPTING;
|
||||||
threadContext->gba->cpu->nextEvent = 0;
|
threadContext->gba->cpu->nextEvent = 0;
|
||||||
if (threadContext->debugger && threadContext->debugger->state == DEBUGGER_RUNNING) {
|
|
||||||
threadContext->debugger->state = DEBUGGER_EXITING;
|
|
||||||
}
|
|
||||||
ConditionWake(&threadContext->stateCond);
|
ConditionWake(&threadContext->stateCond);
|
||||||
_waitUntilNotState(threadContext, THREAD_INTERRUPTING);
|
_waitUntilNotState(threadContext, THREAD_INTERRUPTING);
|
||||||
MutexUnlock(&threadContext->stateMutex);
|
MutexUnlock(&threadContext->stateMutex);
|
||||||
|
|
Loading…
Reference in New Issue