From 846470482c0726a9d9301fbf05094fdb54d3b793 Mon Sep 17 00:00:00 2001 From: Han Ming Ong Date: Sat, 25 Feb 2012 01:07:38 +0000 Subject: Added ability to debug root processes on OS X. This uses XPC service that is available on Lion and above only. llvm-svn: 151419 --- lldb/source/API/SBTarget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lldb/source/API/SBTarget.cpp') diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index 2b6489a80a0..51c0720d86c 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -901,6 +901,14 @@ SBTarget::AttachToProcessWithID 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! -- cgit v1.2.3