Re: Debugging a privileged process
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.