all repos — mgba @ d5ce3d5ee142e93eda9d645f1a96cd24406290ff

mGBA Game Boy Advance Emulator

Debugger: Enable GDB stub to update while running
Jeffrey Pfau jeffrey@endrift.com
Thu, 15 Jan 2015 21:23:32 -0800
commit

d5ce3d5ee142e93eda9d645f1a96cd24406290ff

parent

535d179eb09955993596c30300376631a54e6a6f

1 files changed, 4 insertions(+), 3 deletions(-)

jump to
M src/debugger/gdb-stub.csrc/debugger/gdb-stub.c

@@ -53,7 +53,7 @@ }

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 @@ return;

} } GDBStubUpdate(stub); - } + } while (stub->d.state == DEBUGGER_PAUSED); } static void _ack(struct GDBStub* stub) {

@@ -169,7 +169,7 @@ _sendMessage(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 @@ stub->d.init = 0;

stub->d.deinit = _gdbStubDeinit; stub->d.paused = _gdbStubPoll; stub->d.entered = _gdbStubEntered; + stub->d.custom = _gdbStubPoll; stub->d.log = 0; }