gdb_server: don't send unrequested ACK at connection

On 2008-03-05, before git's age, commit 6d95014674 adds sending
an ACK ('+' char) at GDB connection, before receiving any GDB
remote command that requires to be ACK'ed.

Neither the text added in the commit message ("added ACK upon
connection (send +)") nor in the associated comment ("send ACK to
GDB for debug request") provide an exhaustive explanation for
sending this unsolicited ACK.

This code has never been touched since its introduction.

Analysis of GDB code doesn't show it's required, including old GDB
code.
Running gdbserver (from GDB package) and attaching it with "nc"
shows that gdbserver does not send any ACK to a new connection.
Same for lldb-server.

Drop it!

Change-Id: Id68c352ce44dd85a1ea3d67446e17e2a241ef058
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6768
Tested-by: jenkins
Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-by: Anatoly P <anatoly.parshintsev@syntacore.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Antonio Borneo 2021-12-04 00:48:23 +01:00
parent 271c4e5253
commit 07141132a7
1 changed files with 0 additions and 3 deletions

View File

@ -1001,9 +1001,6 @@ static int gdb_new_connection(struct connection *connection)
gdb_connection->output_flag = GDB_OUTPUT_NO;
gdb_connection->unique_index = next_unique_id++;
/* send ACK to GDB for debug request */
gdb_write(connection, "+", 1);
/* output goes through gdb connection */
command_set_output_handler(connection->cmd_ctx, gdb_output, connection);