[Lldb-commits] [PATCH] D102562: Fix to the interrupt timeout handling: reset the timeout on re-entry

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat May 15 15:05:27 PDT 2021


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);
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102562.345653.patch
Type: text/x-patch
Size: 638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210515/fc81c830/attachment.bin>


More information about the lldb-commits mailing list