This is an automated email from Gerrit.

"Antonio Borneo <borneo.anto...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/6771

-- gerrit

commit 9b7d7ca3f1cdd3a92e44fd0cd9d8ce3f270a287f
Author: Antonio Borneo <borneo.anto...@gmail.com>
Date:   Thu Dec 9 11:14:36 2021 +0100

    gdb_server: add workaround for lldb
    
    lldb till 13.0.0 fails when junk bytes (used by OpenOCD for
    keepalive) enter in the same packet with the reply of a command.
    Add a delay after the initial ACK, so the following "$OK#9a" will
    be processed separately.
    
    Change-Id: Iab4fd5ab67043001db527574557405609543bf62
    Signed-off-by: Antonio Borneo <borneo.anto...@gmail.com>

diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 294e13e01..a45e32276 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -716,6 +716,15 @@ static int gdb_get_packet_inner(struct connection 
*connection,
                        retval = gdb_write(connection, "+", 1);
                        if (retval != ERROR_OK)
                                return retval;
+
+                       /* Hack for lldb bug in CheckForPacket()
+                        * To safely handle OpenOCD keep-alive on new 
connections, add a
+                        * delay so the command reply would be is a separate 
network packet
+                        * than the ACK just sent above.
+                        * This hack could be removed when lldb 13.0.0 would be 
obsolete.
+                        */
+                       if (*len == 15 && strncmp(buffer, "QStartNoAckMode", 
15) == 0)
+                               usleep(200000);
                        break;
                }
        }

-- 

Reply via email to