diff options
| author | Todd Fiala <todd.fiala@gmail.com> | 2014-10-02 14:41:15 +0000 |
|---|---|---|
| committer | Todd Fiala <todd.fiala@gmail.com> | 2014-10-02 14:41:15 +0000 |
| commit | 404e370892a8548cf6656b0913b51701001123fa (patch) | |
| tree | 1c5007070061b20b1c27cf2f6240bf2566ed766d /lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp | |
| parent | 4bb603b2aadb74369f6941be0c40e7dbe3fe1c5a (diff) | |
| download | bcm5719-llvm-404e370892a8548cf6656b0913b51701001123fa.tar.gz bcm5719-llvm-404e370892a8548cf6656b0913b51701001123fa.zip | |
thread state coordinator: requesting resume now signals error appropriately.
Added tests to verify that the coordinator signals an error if
the given thread to resume is unknown, and if the thread is through to
be running already.
Modified resume handling code to match tests.
llvm-svn: 218872
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp index 429c70b9030..7f20717f3bf 100644 --- a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp +++ b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp @@ -333,18 +333,25 @@ public: EventLoopResult ProcessEvent(ThreadStateCoordinator &coordinator) override { - // Tell the thread to resume if we don't already think it is running. + // Ensure we know about the thread. auto find_it = coordinator.m_tid_stop_map.find (m_tid); if (find_it == coordinator.m_tid_stop_map.end ()) { - // Skip the resume call - we think it is already running because we don't know anything about the thread. - coordinator.Log ("EventRequestResume::%s skipping resume request because we don't know about tid %" PRIu64 " and we therefore assume it is running.", __FUNCTION__, m_tid); + // We don't know about this thread. This is an error condition. + std::ostringstream error_message; + error_message << "error: tid " << m_tid << " asked to resume but tid is unknown"; + m_error_function (error_message.str ()); return eventLoopResultContinue; } - else if (!find_it->second) + + // Tell the thread to resume if we don't already think it is running. + const bool is_stopped = find_it->second; + if (!is_stopped) { // Skip the resume call - we have tracked it to be running. - coordinator.Log ("EventRequestResume::%s skipping resume request because tid %" PRIu64 " is already running according to our state tracking.", __FUNCTION__, m_tid); + std::ostringstream error_message; + error_message << "error: tid " << m_tid << " asked to resume but we think it is already running"; + m_error_function (error_message.str ()); return eventLoopResultContinue; } |

