• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Debugging a privileged process
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugging a privileged process


  • Subject: Re: Debugging a privileged process
  • From: Jim Ingham <email@hidden>
  • Date: Mon, 26 Jan 2004 10:57:26 -0800

Kaelin,

On Jan 24, 2004, at 5:55 PM, Kaelin Colclasure wrote:

Greetings,

I've just finished porting a daemon program that uses raw sockets to Mac OS X, and now I'd like to be able to use Xcode's snazzy GDB integration to debug it, Shark to profile it, etc. Since it uses raw sockets, it must or course run as a privileged process. Is it possible to accomplish this from the Xcode IDE? Do I need to run all of Xcode under sudo? (And if so are there any caveats to doing so? ISTR some admonishments against using the AppKit classes in a privileged process.)

Yes, you need to run Xcode under sudo. Dunno about caveats, though.


And on a related topic, I am accustomed to being able to attach GDB to a running process (designated by PID) and start a debugging session that way. Yet I did not see any obvious option for doing this from Xcode... Did I just miss it, or should I file an enhancement request? :-)

There isn't any UI for doing this, but it is pretty easy to do. Open the inspector for the executable that you want to debug (just double-click on the name in the Executable section of the Group tree). Scroll down to the bottom, and in Launch Configuration, configure the Debug action, and set After Launching to "Do not start executable". Then start the debugger, go to the console and type


(gdb) attach PID

Don't bother filing an enhancement request on this one, we have a couple already..

Jim
--
Jim Ingham                                   email@hidden
Developer Tools
Apple Computer
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Debugging a privileged process
      • From: Kaelin Colclasure <email@hidden>
References: 
 >Debugging a privileged process (From: Kaelin Colclasure <email@hidden>)

  • Prev by Date: Use caution when using precompiled headers with XCode 1.1
  • Next by Date: Source trees & include paths
  • Previous by thread: Debugging a privileged process
  • Next by thread: Re: Debugging a privileged process
  • Index(es):
    • Date
    • Thread