diff options
author | Chaoren Lin <chaorenl@google.com> | 2015-02-03 01:50:51 +0000 |
---|---|---|
committer | Chaoren Lin <chaorenl@google.com> | 2015-02-03 01:50:51 +0000 |
commit | b8af31d4b60bee8dc4faefad30764cbce219e2a9 (patch) | |
tree | 6ebb0a0b47a363fc4cb79327b6733562ec80931c /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | |
parent | 03f12d6b224cb6691a4fee4e08adc156a3a8fd28 (diff) | |
download | bcm5719-llvm-b8af31d4b60bee8dc4faefad30764cbce219e2a9.tar.gz bcm5719-llvm-b8af31d4b60bee8dc4faefad30764cbce219e2a9.zip |
Fix some bugs in llgs thread state handling.
* When the thread state coordinator is told to skip sending a stop request
for a running thread that is ignored (e.g. the thread that steps in a
step operation is technically running and should not have a stop sent
to it, since it will stop of its own accord per the kernel step operation),
ensure the deferred signal notification logic still waits for the
skipped thread. (i.e. we want to defer the notification until the
stepping thread is indeed stopped, we just don't want to send it a tgkill).
* Add ThreadStateCoordinator::RequestResumeAsNeeded(). This variant of the
RequestResume() method does not call the error function when the thread
is already running. Instead, it just logs that the thread is already
running and skips the resume operation. This is useful for the case of
vCont;c handling, where we tell all threads that they should be running.
At the place we're calling, all we know is "we want this thread running if
it isn't already," and that's exactly what this command does.
* Formatting change (minor) in NativeThreadLinux logging.
llvm-svn: 227913
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index 5c297589172..da71e15f991 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -166,7 +166,7 @@ namespace { Log *const log = GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD); if (log) - log->Printf ("NativePlatformLinux::%s ThreadStateCoordinator error received: %s", __FUNCTION__, error_message.c_str ()); + log->Printf ("NativePlatformLinux::%s %s", __FUNCTION__, error_message.c_str ()); assert (false && "ThreadStateCoordinator error reported"); } @@ -2689,14 +2689,14 @@ NativeProcessLinux::Resume (const ResumeActionList &resume_actions) { // Run the thread, possibly feeding it the signal. const int signo = action->signal; - m_coordinator_up->RequestThreadResume (thread_sp->GetID (), - [=](lldb::tid_t tid_to_resume) - { - reinterpret_cast<NativeThreadLinux*> (thread_sp.get ())->SetRunning (); - // Pass this signal number on to the inferior to handle. - Resume (tid_to_resume, (signo > 0) ? signo : LLDB_INVALID_SIGNAL_NUMBER); - }, - CoordinatorErrorHandler); + m_coordinator_up->RequestThreadResumeAsNeeded (thread_sp->GetID (), + [=](lldb::tid_t tid_to_resume) + { + reinterpret_cast<NativeThreadLinux*> (thread_sp.get ())->SetRunning (); + // Pass this signal number on to the inferior to handle. + Resume (tid_to_resume, (signo > 0) ? signo : LLDB_INVALID_SIGNAL_NUMBER); + }, + CoordinatorErrorHandler); ++resume_count; break; } |