9

I am used to having a stack trace appear in the console when I don't catch an exception and it throws it back to the main function. Is there a build setting somewhere in Xcode 4.2 that I don't have on? Right now, it shows nothing in the console at all.

logancautrell
  • 8,762
  • 3
  • 39
  • 50
Samuel Hicks
  • 113
  • 1
  • 4

2 Answers2

29

Try adding a breakpoint on exception.

  1. Click on the breakpoint's tab (cmd + 6)
  2. Click the add ('+') button bottom left.
  3. Click 'Add Exception Breakpoint...'
  4. Leave the defaults and click done.

Now when an exception is thrown it should drop you into debugger at the line that throws the exception.

Paul.s
  • 38,494
  • 5
  • 70
  • 88
  • 3
    @Hot Licks Yep. This started happening in the last few versions of xcode. Very annoying. Adding a breakpoint exception doesn't work for me either. – memmons Sep 04 '12 at 15:07
  • @Answerbot - Check out [this thread](http://stackoverflow.com/questions/8100054/no-exception-stack-trace-in-console-under-xcode-4-2-ios-5). – Hot Licks Sep 04 '12 at 16:06
2

This is usually indicative of a problem with LLDB (debugger). I love LLDB, but when it comes to showing stack traces and breaking on the exception rather than main in iOS apps, it's a pain in the ass and has been for a few releases now. No idea why Apple hasn't addressed this yet. To fix it is a two-step process:

  1. Edit your current scheme and under the "Run" tab change the debugger from LLDB to GDB.
  2. Go to https://developer.apple.com/bugreporter/ and report the bug so Apple addresses it.
memmons
  • 40,222
  • 21
  • 149
  • 183
  • 2
    It's a well-known "feechure" of later Xcode versions. See [this thread](http://stackoverflow.com/questions/8100054/no-exception-stack-trace-in-console-under-xcode-4-2-ios-5). – Hot Licks Sep 04 '12 at 16:07