Fixed the issue that was causing our monitor process threads to crash, it 
turned out to be unitialized data in the ProcessLaunchInfo default constructor. 
Turning on MallocScribble in the environment helped track this down. 

When we launch and attach using the host layer, we now inform the process that
it shouldn't detach when by calling an accessor.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144882 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index df01e94..fed40e0 100644
--- a/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -97,6 +97,11 @@
 ProcessKDP::~ProcessKDP()
 {
     Clear();
+    // We need to call finalize on the process before destroying ourselves
+    // to make sure all of the broadcaster cleanup goes as planned. If we
+    // destruct this class, then Process::~Process() might have problems
+    // trying to fully destroy the broadcaster.
+    Finalize();
 }
 
 //----------------------------------------------------------------------
@@ -620,7 +625,6 @@
 void
 ProcessKDP::Clear()
 {
-    Mutex::Locker locker (m_thread_list.GetMutex ());
     m_thread_list.Clear();
 }