From d5ce3d5ee142e93eda9d645f1a96cd24406290ff Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 15 Jan 2015 21:23:32 -0800 Subject: [PATCH] Debugger: Enable GDB stub to update while running --- src/debugger/gdb-stub.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/debugger/gdb-stub.c b/src/debugger/gdb-stub.c index 921fb151f..bc43a1df3 100644 --- a/src/debugger/gdb-stub.c +++ b/src/debugger/gdb-stub.c @@ -53,7 +53,7 @@ static void _gdbStubEntered(struct ARMDebugger* debugger, enum DebuggerEntryReas static void _gdbStubPoll(struct ARMDebugger* debugger) { struct GDBStub* stub = (struct GDBStub*) debugger; - while (stub->d.state == DEBUGGER_PAUSED) { + do { if (!SOCKET_FAILED(stub->connection)) { if (!SocketSetBlocking(stub->connection, 1)) { GDBStubHangup(stub); @@ -61,7 +61,7 @@ static void _gdbStubPoll(struct ARMDebugger* debugger) { } } GDBStubUpdate(stub); - } + } while (stub->d.state == DEBUGGER_PAUSED); } static void _ack(struct GDBStub* stub) { @@ -169,7 +169,7 @@ static void _writeHostInfo(struct GDBStub* stub) { } static void _continue(struct GDBStub* stub, const char* message) { - stub->d.state = DEBUGGER_RUNNING; + stub->d.state = DEBUGGER_CUSTOM; if (!SOCKET_FAILED(stub->connection)) { if (!SocketSetBlocking(stub->connection, 0)) { GDBStubHangup(stub); @@ -443,6 +443,7 @@ void GDBStubCreate(struct GDBStub* stub) { stub->d.deinit = _gdbStubDeinit; stub->d.paused = _gdbStubPoll; stub->d.entered = _gdbStubEntered; + stub->d.custom = _gdbStubPoll; stub->d.log = 0; }