<rdar://problem/3535148>

Added ability to debug root processes on OS X. This uses XPC service that is available on Lion and above only.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151419 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBTarget.cpp b/source/API/SBTarget.cpp
index 2b6489a..51c0720 100644
--- a/source/API/SBTarget.cpp
+++ b/source/API/SBTarget.cpp
@@ -901,6 +901,14 @@
             
             ProcessAttachInfo attach_info;
             attach_info.SetProcessID (pid);
+            
+            PlatformSP platform_sp = target_sp->GetPlatform();
+            ProcessInstanceInfo instance_info;
+            if (platform_sp->GetProcessInfo(pid, instance_info))
+            {
+                attach_info.SetUserID(instance_info.GetEffectiveUserID());
+                
+            }
             error.SetError (process_sp->Attach (attach_info));            
             // If we are doing synchronous mode, then wait for the
             // process to stop!