llvm-project/lldb/unittests/Process/gdb-remote
Pavel Labath 165545c7a4 [lldb/gdb-remote] Ignore spurious ACK packets
Although I cannot find any mention of this in the specification, both
gdb and lldb agree on sending an initial + packet after establishing the
connection.

OTOH, gdbserver and lldb-server behavior is subtly different. While
lldb-server *expects* the initial ack, and drops the connection if it is
not received, gdbserver will just ignore a spurious ack at _any_ point
in the connection.

This patch changes lldb's behavior to match that of gdb. An ACK packet
is ignored at any point in the connection (except when expecting an ACK
packet, of course). This is inline with the "be strict in what you
generate, and lenient in what you accept" philosophy, and also enables
us to remove some special cases from the server code. I've extended the
same handling to NAK (-) packets, mainly because I don't see a reason to
treat them differently here.

(The background here is that we had a stub which was sending spurious
+ packets. This bug has since been fixed, but I think this change makes
sense nonetheless.)

Differential Revision: https://reviews.llvm.org/D114520
2021-11-25 12:34:08 +01:00
..
CMakeLists.txt [lldb] [lldb-gdbserver] Unify listen/connect code to use ConnectionFileDescriptor 2021-10-26 13:06:19 +02:00
GDBRemoteClientBaseTest.cpp Revert "Revert "Reset the wakeup timeout when we re-enter the continue wait."" 2021-07-12 14:20:49 -07:00
GDBRemoteCommunicationClientTest.cpp [lldb] Correct format of qMemTags type field 2021-07-30 11:06:57 +01:00
GDBRemoteCommunicationServerLLGSTest.cpp [lldb] [lldb-gdbserver] Unify listen/connect code to use ConnectionFileDescriptor 2021-10-26 13:06:19 +02:00
GDBRemoteCommunicationServerTest.cpp
GDBRemoteCommunicationTest.cpp [lldb/gdb-remote] Ignore spurious ACK packets 2021-11-25 12:34:08 +01:00
GDBRemoteTestUtils.cpp
GDBRemoteTestUtils.h [lldb/gdb-remote] Ignore spurious ACK packets 2021-11-25 12:34:08 +01:00
PortMapTest.cpp [lldb] Error when there are no ports to launch a gdbserver on 2020-11-30 10:19:14 +00:00