summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-06-30 19:00:09 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-06-30 19:00:09 +0000
commit135cf982e8ee9e2f0d8af1b33ee214737e1ae707 (patch)
tree6b8ee4124f0824cd19810bdd999dcdba44838c22 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
parent706b48251f6a30cf03185c34d93e907ba1e05de2 (diff)
downloadbcm5719-llvm-135cf982e8ee9e2f0d8af1b33ee214737e1ae707.tar.gz
bcm5719-llvm-135cf982e8ee9e2f0d8af1b33ee214737e1ae707.zip
Revert "[GDBRemote] Remove code that flushes GDB remote packets"
Reverting this again as it doesn't appear to solve the flakiness on the LLDB standalone bot. llvm-svn: 364722
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 0d6b45a2286..9797184026e 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -115,6 +115,13 @@ bool GDBRemoteCommunicationClient::HandshakeWithServer(Status *error_ptr) {
// Start the read thread after we send the handshake ack since if we fail to
// send the handshake ack, there is no reason to continue...
if (SendAck()) {
+ // Wait for any responses that might have been queued up in the remote
+ // GDB server and flush them all
+ StringExtractorGDBRemote response;
+ PacketResult packet_result = PacketResult::Success;
+ while (packet_result == PacketResult::Success)
+ packet_result = ReadPacket(response, milliseconds(10), false);
+
// The return value from QueryNoAckModeSupported() is true if the packet
// was sent and _any_ response (including UNIMPLEMENTED) was received), or
// false if no response was received. This quickly tells us if we have a
OpenPOWER on IntegriCloud