From c727fe695d28799acb499e9961f11ec07d4f9fe2 Mon Sep 17 00:00:00 2001 From: emaste Date: Wed, 6 Nov 2013 16:48:53 +0000 Subject: Import lldb as of SVN r194122 Sponsored by: DARPA, AFRL --- source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp | 44 ++++++++++++++++++++--- 1 file changed, 40 insertions(+), 4 deletions(-) (limited to 'source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp') diff --git a/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp index ea26d97..952ec95 100644 --- a/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ b/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -122,11 +122,47 @@ ProcessFreeBSD::Terminate() { } +Error +ProcessFreeBSD::DoDetach(bool keep_stopped) +{ + Error error; + if (keep_stopped) + { + error.SetErrorString("Detaching with keep_stopped true is not currently supported on FreeBSD."); + return error; + } + + error = m_monitor->Detach(GetID()); + + if (error.Success()) + SetPrivateState(eStateDetached); + + return error; +} + bool ProcessFreeBSD::UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list) { - // XXX haxx - new_thread_list = old_thread_list; - - return false; + Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD)); + if (log && log->GetMask().Test(POSIX_LOG_VERBOSE)) + log->Printf ("ProcessFreeBSD::%s() (pid = %" PRIu64 ")", __FUNCTION__, GetID()); + + bool has_updated = false; + const lldb::pid_t pid = GetID(); + // Update the process thread list with this new thread. + // FIXME: We should be using tid, not pid. + assert(m_monitor); + ThreadSP thread_sp (old_thread_list.FindThreadByID (pid, false)); + if (!thread_sp) { + ProcessSP me = this->shared_from_this(); + thread_sp.reset(new POSIXThread(*me, pid)); + has_updated = true; + } + + if (log && log->GetMask().Test(POSIX_LOG_VERBOSE)) + log->Printf ("ProcessFreeBSD::%s() updated tid = %" PRIu64, __FUNCTION__, pid); + + new_thread_list.AddThread(thread_sp); + + return has_updated; // the list has been updated } -- cgit v1.1