Xcode 4: Tracking Down Crashes with Exception Breakpoints

Xcode 4 offers a simple way to generate a breakpoint whenever an exception occurs. A great idea when you need to track down application crashes.

Here’s how to set a global breakpoint (so to speak):

In the break point navigator (⌘6), click the plus (+) symbol in the lower left corner. Choose Add Exception Breakpoint. The exception breakpoint options are shown in the dialog below:

There are a number of options on the exception type (All, Objective-C or C++), whether to break on throw or catch, as well as the action once the exception is throw (e.g. log message, run debugger command, etc).

  1. Hi,

    Thanks for the tips. But it does not catch just “crashes” (a.k.a. Uncaught Exceptions). It catch all exceptions (even if they are catched). So, it could be very painfull if you use NSExceptions and try / catch.

Comments are closed.