summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 50a7aec4c17..ee03424e528 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -199,14 +199,14 @@ GDBRemoteCommunication::SendContinuePacketAndWaitForResponse
log->Printf ("GDBRemoteCommunication::%s ()", __FUNCTION__);
Mutex::Locker locker(m_sequence_mutex);
- m_is_running.SetValue (true, eBroadcastNever);
-
// ScopedValueChanger<bool> restore_running_to_false (m_is_running, false);
StateType state = eStateRunning;
if (SendPacket(payload, packet_length) == 0)
state = eStateInvalid;
+ m_is_running.SetValue (true, eBroadcastAlways);
+
while (state == eStateRunning)
{
log = ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS);
@@ -856,3 +856,19 @@ GDBRemoteCommunication::DeallocateMemory (addr_t addr, uint32_t timeout_seconds)
}
return false;
}
+
+bool
+GDBRemoteCommunication::WaitForIsRunning (uint32_t timeout_sec)
+{
+ TimeValue timeout;
+ if (timeout_sec)
+ {
+ timeout = TimeValue::Now();
+ timeout.OffsetWithSeconds (timeout_sec);
+ }
+ bool timed_out = false;
+ m_is_running.WaitForValueEqualTo (true, &timeout, &timed_out);
+ return timed_out;
+}
+
+
OpenPOWER on IntegriCloud