From 82aae0d835a33e56ae8881eff301dade55a022c2 Mon Sep 17 00:00:00 2001 From: Andrew MacPherson Date: Wed, 2 Apr 2014 06:57:45 +0000 Subject: Use getpgid() with waitpid() in case the process pgid is not equal to its pid, as is the case with a forked subprocess. Also a couple of fixes for unit test failures from Todd Fiala. llvm-svn: 205405 --- lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/Process/POSIX') diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp index 47e11353714..94892b194ca 100644 --- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp +++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp @@ -379,6 +379,8 @@ ProcessPOSIX::DoDidExec() void ProcessPOSIX::SendMessage(const ProcessMessage &message) { + Log *log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS)); + Mutex::Locker lock(m_message_mutex); Mutex::Locker thread_lock(m_thread_list.GetMutex()); @@ -420,8 +422,14 @@ ProcessPOSIX::SendMessage(const ProcessMessage &message) break; case ProcessMessage::eExitMessage: - assert(thread); - thread->SetState(eStateExited); + if (thread != nullptr) + thread->SetState(eStateExited); + else + { + if (log) + log->Warning ("ProcessPOSIX::%s eExitMessage for TID %" PRIu64 " failed to find a thread to mark as eStateExited, ignoring", __FUNCTION__, message.GetTID ()); + } + // FIXME: I'm not sure we need to do this. if (message.GetTID() == GetID()) { -- cgit v1.2.3