How would I debug a Unity-plugin from XCode?

What are the proper settings in XCode to debug a Unity Objective C/C++ plugin? I would like to know exactly what project settings are needed and how I should hook up XCode with Unity in order to start debugging.

I haven't tried this for Unity C++ plugins, but this is normally how you debug dynamic libraries in XCode (works with our web plugin):

Build a debug version of your plugin. Then either: -Run Unity, in XCode "Run" menu choose "Attach to Process" to attach to Unity -Or choose "Project"->"New Custom Executable", Choose, set the working directory to Unity, and then run that executable from XCode.

gdb cannot be used to debug a plugin to my knowledge you should just do things like printing stuff to screen and what not to debug it.

I just managed to debug the bonjour client sample. Until now message "Previous frame inner to this frame (gdb could not unwind past this frame)" shows up on every break point hit, but it works so far. Although I use debug settings and GCC 4.2 as proposed in related question on stack overflow, I get these warnings. I guess there is some Unity code compiled using LLVM, but can live with that.