Added an "Interrupted" bit to the ProcessEventData. Halt now generates an event
with the Interrupted bit set. Process::HandlePrivateEvent ignores Interrupted events.
DoHalt is changed to ensure that the stop even is processed, and an event with
the Interrupted event is posted. Finally ClangFunction is rationalized to use this
facility so the that Halt is handled more deterministically.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119453 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 50a7aec..ee03424 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -199,14 +199,14 @@
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 @@
}
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;
+}
+
+