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
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.