jingham created this revision.
jingham added reviewers: clayborg, JDevlieghere.
jingham requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

The new timeout handling missed one case where we need to reset the computed 
timeout: when a packet interrupts the Continue wait, but asks to re-enter the 
wait loop when done.

This is the only other way to get back to the ReadPacket call, so this is the 
only other place that requires reset.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102562

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


Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
===================================================================
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
@@ -152,6 +152,10 @@
       OnRunPacketSent(false);
       break;
     }
+    // If we get here, we were interrupted asynchronously, and told to resume
+    // and continue waiting.  Reset the computed_timeout, since it might have
+    // gotten shortened in waiting for the interrupt.
+    computed_timeout = std::min(interrupt_timeout, kWakeupInterval);
   }
 }
 


Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
===================================================================
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
@@ -152,6 +152,10 @@
       OnRunPacketSent(false);
       break;
     }
+    // If we get here, we were interrupted asynchronously, and told to resume
+    // and continue waiting.  Reset the computed_timeout, since it might have
+    // gotten shortened in waiting for the interrupt.
+    computed_timeout = std::min(interrupt_timeout, kWakeupInterval);
   }
 }
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to