4. Debugging

It is easy to use the GNU debugger, gdb, to examine the operation of any Cocoa application, including applications built with RubyObjC.

To do so, start gdb from the terminal with the following command:
% gdb MyApp.app/Contents/MacOS/MyApp

Note that we are running gdb on the executable stored inside the application bundle and not the application bundle itself.

Apple has published some useful tricks in their technical note TN2124: Mac OS X Debugging Magic.

See especially this section on debugging Objective-C code to see how to log Objective-C message sends. In a blog post, Dave Dribin showed how to do this programmatically.

Did you find an error? Is something missing? Post your comment or suggestion below!

Comments (0) post