Skip to content

Commit

Permalink
gdbstub: don't complain about preemptive ACK chars
Browse files Browse the repository at this point in the history
When starting a remote connection GDB sends an '+':

  /* Ack any packet which the remote side has already sent.  */
  remote_serial_write ("+", 1);

which gets flagged as a garbage character in the gdbstub state
machine. As gdb does send it out lets be permissive about the handling
so we can better see real issues.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Cc: gdb-patches@sourceware.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230810153640.1879717-9-alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
stsquad authored and rth7680 committed Aug 10, 2023
1 parent 3869eb7 commit f1b0f89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gdbstub/gdbstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,11 @@ void gdb_read_byte(uint8_t ch)
gdbserver_state.line_buf_index = 0;
gdbserver_state.line_sum = 0;
gdbserver_state.state = RS_GETLINE;
} else if (ch == '+') {
/*
* do nothing, gdb may preemptively send out ACKs on
* initial connection
*/
} else {
trace_gdbstub_err_garbage(ch);
}
Expand Down

0 comments on commit f1b0f89

Please sign in to comment.