summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-09-26 23:42:53 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-09-26 23:42:53 +0000
commite9c9e7070e5f58ed071bd08887ce744d42303478 (patch)
tree5634d8c2efe5d74ef667ef7b830213531dac86e1 /lldb/source/Plugins/Process/Linux
parentd20d44fbe6e92ab8ef866be3c6c6e405edbcf382 (diff)
downloadbcm5719-llvm-e9c9e7070e5f58ed071bd08887ce744d42303478.tar.gz
bcm5719-llvm-e9c9e7070e5f58ed071bd08887ce744d42303478.zip
thread state coordinator: handle when prerequisite pending stop is already stopped.
Change includes new gtest and functionality. llvm-svn: 218555
Diffstat (limited to 'lldb/source/Plugins/Process/Linux')
-rw-r--r--lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp
index 50f8b2e9b6b..22f2f592951 100644
--- a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp
+++ b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp
@@ -94,12 +94,27 @@ public:
bool
ProcessEvent(ThreadStateCoordinator &coordinator) override
{
- // Request a stop for all the thread stops that are needed.
- // In the future, we can keep track of which stops we're
- // still waiting for, and can not re-issue for already
- // requested stops.
+ // Request a stop for all the thread stops that need to be stopped
+ // and are not already known to be stopped. Keep a list of all the
+ // threads from which we still need to hear a stop reply.
+
+ ThreadIDSet sent_tids;
for (auto tid : m_wait_for_stop_tids)
- m_request_thread_stop_func (tid);
+ {
+ // If we don't know about the thread's stop state or we
+ // know it is not stopped, we need to send it a stop request.
+ auto find_it = coordinator.m_tid_stop_map.find (tid);
+ if ((find_it == coordinator.m_tid_stop_map.end ()) || !find_it->second)
+ {
+ m_request_thread_stop_func (tid);
+ sent_tids.insert (tid);
+ }
+ }
+
+ // We only need to wait for the sent_tids - so swap our wait set
+ // to the sent tids. The rest are already stopped and we won't
+ // be receiving stop notifications for them.
+ m_wait_for_stop_tids.swap (sent_tids);
if (m_wait_for_stop_tids.empty ())
{
OpenPOWER on IntegriCloud