Alex Rivera | Logout

Debugging in XCode as root

Asked 2009-06-23T14:46:31.970
31

In my program I need to create sockets and bind them to listen HTTP port (80). The program works fine when I launch it from command line with sudo, escalating permissions to root. Running under XCode gives a 'permission denied' error on the call to binding function (asio::ip::tcp::acceptor::bind()).

How can I do debugging under XCode?

All done in C++ and boost.asio on Mac OS X 10.5 with XCode 3.1.2.

Edit
Report

1 Answer

3

XCode no longer supports remote debugging rendering most of these answers obsolete.

For debugging a program as root it is now easy. Under the Product menu, use "Edit Scheme…" and in your "Run" schemes "Info" pane, select "Debug process as root". You will have to authenticate once.

As of Xcode 4.5 I got a strange error until I quite Xcode and restarted.

answered 2012-10-01T20:54:39.490

Your Answer