]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
server/gdb_server: do not discard Ctrl-C if _DEBUG_GDB_IO_
authorTomas Vanek <vanekt@fbl.cz>
Sun, 18 May 2025 19:25:35 +0000 (21:25 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 25 May 2025 12:45:44 +0000 (12:45 +0000)
GDB server debug logging eat Ctrl-C when gdb user issues interrupt
in time of communication between OpenOCD and gdb.
E.g. Ctrl-C after `next` gdb command taking many
gdb remote protocol $vCont;s (steps)

Change-Id: I4a65446a9bb25a28e50566607b3dec116fa7d2cd
Suggested-by: Tim Newsome <tim@sifive.com>
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8920
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/server/gdb_server.c

index 71b7c7764a5c75899674bfe0770ebe4cf2543f66..bd00feb490496e5039f93fdb00a268ca9d182706 100644 (file)
@@ -434,6 +434,10 @@ static int gdb_put_packet_inner(struct connection *connection,
                        gdb_putback_char(connection, reply);
                        LOG_DEBUG("Unexpected start of new packet");
                        break;
+               } else if (reply == 0x3) {
+                       /* do not discard Ctrl-C */
+                       gdb_putback_char(connection, reply);
+                       break;
                }
 
                LOG_WARNING("Discard unexpected char %c", reply);