diff options
| author | Jason Molenda <jmolenda@apple.com> | 2011-09-13 00:52:59 +0000 |
|---|---|---|
| committer | Jason Molenda <jmolenda@apple.com> | 2011-09-13 00:52:59 +0000 |
| commit | 542adbfccf6d5149eda2311415d8138331b945e0 (patch) | |
| tree | 591fe7abb5e26623d12803b1f34707fd39693346 | |
| parent | a93ab13e0bf61c92f398f1e5697b79d04974dc29 (diff) | |
| download | bcm5719-llvm-542adbfccf6d5149eda2311415d8138331b945e0.tar.gz bcm5719-llvm-542adbfccf6d5149eda2311415d8138331b945e0.zip | |
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...
llvm-svn: 139566
| -rw-r--r-- | lldb/source/Host/macosx/Host.mm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/source/Host/macosx/Host.mm b/lldb/source/Host/macosx/Host.mm index de2a9085910..0fd3bc82a78 100644 --- a/lldb/source/Host/macosx/Host.mm +++ b/lldb/source/Host/macosx/Host.mm @@ -1095,6 +1095,10 @@ Host::FindProcesses (const ProcessInstanceInfoMatch &match_info, ProcessInstance 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) |

