From: OpenOCD-Gerrit <ope...@us...> - 2021-12-18 17:27:15
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 5795f4d3ef938172e3d7a942ed57023572650037 (commit) from 29e689ede680f0b3bd106b80b9844c45459265e4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5795f4d3ef938172e3d7a942ed57023572650037 Author: Antonio Borneo <bor...@gm...> Date: Sat Dec 4 18:38:56 2021 +0100 gdb_server: fix a comment in gdb_new_connection() On 2008-03-05, before git's age, commit 6d9501467441 adds a comment about unobserved ACK supposedly sent by GDB at connection. The ACK is sent since GDB 3.95 (1999-05-04), but a bug introduced in GDB 6.5 (2006-06-21) and fixed in GDB 7.0 (2009-10-06) makes GDB sending the query for "supported packets" before sending the ACK. Due to the bug, the author of the commit failed to see the ACK. Change-Id: I574a8013e7d159d1c71087af83b7c2ce92be86bd Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6769 Tested-by: jenkins diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 0d2d1ae2c..7c853730f 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1006,16 +1006,19 @@ static int gdb_new_connection(struct connection *connection) breakpoint_clear_target(target); watchpoint_clear_target(target); - /* remove the initial ACK from the incoming buffer */ + /* Since version 3.95 (gdb-19990504), with the exclusion of 6.5~6.8, GDB + * sends an ACK at connection with the following comment in its source code: + * "Ack any packet which the remote side has already sent." + * LLDB does the same since the first gdb-remote implementation. + * Remove the initial ACK from the incoming buffer. + */ retval = gdb_get_char(connection, &initial_ack); if (retval != ERROR_OK) return retval; - /* FIX!!!??? would we actually ever receive a + here??? - * Not observed. - */ if (initial_ack != '+') gdb_putback_char(connection, initial_ack); + target_call_event_callbacks(target, TARGET_EVENT_GDB_ATTACH); if (target->rtos) { ----------------------------------------------------------------------- Summary of changes: src/server/gdb_server.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |