[Lldb-commits] [lldb] r151679 - /lldb/trunk/source/API/SBTarget.cpp

Han Ming Ong hanming at apple.com
Tue Feb 28 16:12:57 PST 2012


Author: hanming
Date: Tue Feb 28 18:12:56 2012
New Revision: 151679

URL: http://llvm.org/viewvc/llvm-project?rev=151679&view=rev
Log:
<rdar://10950312>

Need to GetProcess() to set the uid of the process to attach.

Modified:
    lldb/trunk/source/API/SBTarget.cpp

Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=151679&r1=151678&r2=151679&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Tue Feb 28 18:12:56 2012
@@ -815,6 +815,16 @@
             sb_process.SetSP (process_sp);
             
             ProcessAttachInfo &attach_info = sb_attach_info.ref();
+            lldb::pid_t attach_pid = attach_info.GetProcessID();
+            if (attach_pid != LLDB_INVALID_PROCESS_ID)
+            {
+                PlatformSP platform_sp = target_sp->GetPlatform();
+                ProcessInstanceInfo instance_info;
+                if (platform_sp->GetProcessInfo(attach_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!
@@ -907,7 +917,6 @@
             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





More information about the lldb-commits mailing list