[Lldb-commits] [lldb] r139566 - /lldb/trunk/source/Host/macosx/Host.mm

Jason Molenda jmolenda at apple.com
Mon Sep 12 17:52:59 PDT 2011


Author: jmolenda
Date: Mon Sep 12 19:52:59 2011
New Revision: 139566

URL: http://llvm.org/viewvc/llvm-project?rev=139566&view=rev
Log:
Change the macosx Host::FindProcesses() to include all processes
(running under any uid) if lldb is being run as root.  It might be
better to handle this up at the ProcessInstanceInfoMatch class with
its m_match_all_users ivar instead of down here...

Modified:
    lldb/trunk/source/Host/macosx/Host.mm

Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=139566&r1=139565&r2=139566&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Mon Sep 12 19:52:59 2011
@@ -1095,6 +1095,10 @@
         else
             kinfo_user_matches = kinfo.kp_eproc.e_pcred.p_ruid == our_uid;
 
+        // Special case, if lldb is being run as root we can attach to anything.
+        if (our_uid == 0)
+          kinfo_user_matches = true;
+
         if (kinfo_user_matches == false         || // Make sure the user is acceptable
             kinfo.kp_proc.p_pid == our_pid      || // Skip this process
             kinfo.kp_proc.p_pid == 0            || // Skip kernel (kernel pid is zero)





More information about the lldb-commits mailing list