Reset the wakeup timeout when we re-enter the continue wait.

Differential Revision: https://reviews.llvm.org/D102562
This commit is contained in:
Jim Ingham 2021-05-15 14:59:14 -07:00
parent cd220a0678
commit bd5751f3d2
1 changed files with 3 additions and 0 deletions

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