Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Why does running LLDB or instruments require elevated privilages?

share|improve this question
    
Tracing program execution in to shared libraries that were loaded by a user other than yourself requires you to be a superuser, but I'm sure there are more reasons than just shared library stack tracing. –  Ian C. Feb 20 '13 at 7:18
add comment

1 Answer 1

Scanning protected memory is something only something authorized (in this case authenticated) sudoers are able to do.

Not requiring this would be a huge security risk and is part of the reason Windows from the 90's and early 00's was at higher risk of virus infection. An application could easily dip into the memory partition of another application, viewing or modifying its contents or inserting arbitrary executable code.

share|improve this answer
    
But I seem to remember (though it's entirely possible that I'm remembering incorrectly) in Panther and Tiger (and maybe Leopard, I forget) being able to step through programs in Xcode's debugger in the school computers back in middle school, where I definitely wasn't an admin. –  dented42 Feb 26 '13 at 20:11
1  
When XCode spawns a new process, it "owns" that process. Instruments are launched independently of the executable code from XCode and are unrelated as far as the OS is concerned. I'm not familiar with LLDB but my guess is that there's a way to script its launch from XCode so it is the parent process of the code in question. –  zwerdlds Feb 26 '13 at 21:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.