Break on throw?

Is it possible to set a breakpoint to whenever an error is thrown?

I'm not sure, but I thought I saw this being done in a WWDC video. Perhaps "What's New in lldb", or one of the Swift sessions?

Accepted Answer

Yes, it was mentioned in What’s New in LLDB. The debugger command is:


br s -E swift


It seems that it is not yet possible to enable this breakpoint in the Xcode 7 UI so you have to type it manually in the debugger when you run your program (or put it in your ~/.lldbinit).

That works. Thank you to both of you.

Break on throw?
 
 
Q