Debug Plugin libraries with Xcode
Debugging native C++ code in ShiVa plugins can be a difficult task if you rely exclusively on ShiVa error messages and logging. Coupling ShiVa and Xcode is much more effective.
To check the state of your library code at a certain point, you will need to halt the execution. This is called a breakpoint. Setting one in Xcode will add a blue arrow to a line of code:
Now you need to compile your plugin. Make sure you are building the DEBUG profile, so check your schemes:
Next, you need to attach the Xcode Debugger to the ShiVa Editor process. You can do that in the Debug menu.
Xcode and ShiVa are now linked. Every time a breakpoint is reached, Xcode will halt the execution of your ShiVa game and display the state of your variables, processor, memory etc. inside the debugger.
The controls for the debugger are located in the Debug menu as well. Stepping in/out/over, stop and continue behave as you would expect from any other debugger.