diff options
Diffstat (limited to 'lldb/source/Plugins/Process/Linux')
-rw-r--r-- | lldb/source/Plugins/Process/Linux/ProcessLinux.cpp | 29 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/Linux/ProcessLinux.h | 3 |
2 files changed, 32 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp index e503ff08851..dae14d1c44c 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp @@ -136,6 +136,35 @@ ProcessLinux::EnablePluginLogging(Stream *strm, Args &command) return NULL; } +Error +ProcessLinux::DoDetach(bool keep_stopped) +{ + Error error; + if (keep_stopped) + { + // FIXME: If you want to implement keep_stopped, + // this would be the place to do it. + error.SetErrorString("Detaching with keep_stopped true is not currently supported on Linux."); + return error; + } + + Mutex::Locker lock(m_thread_list.GetMutex()); + + uint32_t thread_count = m_thread_list.GetSize(false); + for (uint32_t i = 0; i < thread_count; ++i) + { + POSIXThread *thread = static_cast<POSIXThread*>( + m_thread_list.GetThreadAtIndex(i, false).get()); + error = m_monitor->Detach(thread->GetID()); + } + + if (error.Success()) + SetPrivateState(eStateDetached); + + return error; +} + + // ProcessPOSIX override void ProcessLinux::StopAllThreads(lldb::tid_t stop_tid) diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.h b/lldb/source/Plugins/Process/Linux/ProcessLinux.h index 742627f37a2..15193b866c2 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessLinux.h +++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.h @@ -54,6 +54,9 @@ public: lldb_private::Listener &listener, lldb_private::FileSpec *core_file); + virtual lldb_private::Error + DoDetach(bool keep_stopped); + virtual bool UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list); |