Reset the wakeup timeout when we re-enter the continue wait.
authorJim Ingham <jingham@apple.com>
Sat, 15 May 2021 21:59:14 +0000 (14:59 -0700)
committerJim Ingham <jingham@apple.com>
Mon, 17 May 2021 17:49:47 +0000 (10:49 -0700)
Differential Revision: https://reviews.llvm.org/D102562

lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp

index 61429b7..a4c71e8 100644 (file)
@@ -61,6 +61,9 @@ StateType GDBRemoteClientBase::SendContinuePacketAndWaitForResponse(
                                                    kWakeupInterval);
   for (;;) {
     PacketResult read_result = ReadPacket(response, computed_timeout, false);
+    // Reset the computed_timeout to the default value in case we are going
+    // round again.
+    computed_timeout = std::min(interrupt_timeout, kWakeupInterval);
     switch (read_result) {
     case PacketResult::ErrorReplyTimeout: {
       std::lock_guard<std::mutex> lock(m_mutex);