Skip to content

Commit

Permalink
[gdb] Allow resynchronisation with gdb
Browse files Browse the repository at this point in the history
This replaces the gdbstub's polite NAK behavior with retransmission of
the current outstanding reply packet.  It solves situations where gdb
and gPXE's gdbstub get out of sync due to the lack of flow control in
the gdb protocol spec.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
  • Loading branch information
stefanha authored and Michael Brown committed Apr 15, 2009
1 parent b149a99 commit 38a1d0f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/core/gdbstub.c
Expand Up @@ -344,12 +344,10 @@ static void gdbstub_state_cksum2 ( struct gdbstub *stub, char ch ) {
static void gdbstub_state_wait_ack ( struct gdbstub *stub, char ch ) {
if ( ch == '+' ) {
stub->parse = gdbstub_state_new;
} else if ( ch == '-' ) {
gdbstub_tx_packet ( stub ); /* retransmit */
} else if ( ch == '$' ) {
/* GDB is reconnecting, drop our packet and listen to GDB */
stub->trans->send ( "-", 1 );
stub->parse = gdbstub_state_new;
} else {
/* This retransmit is very aggressive but necessary to keep
* in sync with GDB. */
gdbstub_tx_packet ( stub );
}
}

Expand Down

0 comments on commit 38a1d0f

Please sign in to comment.