2

Possible Duplicate:
Xcode always stopping at main.m after a crash

On versions of Xcode in the past, every time I was debugging a crash, it stopped the debugging in the culprit line, with an error message.

Xcode 4.2 instead shows me this line in main.m

int retVal = UIApplicationMain(argc, argv, nil, nil);

as the culprit line for the crash, despite the error being in another place.

How do I get this to work in Xcode 4.2 like it used to work in earlier versions?

Community
  • 1
  • 1
Duck
  • 34,902
  • 47
  • 248
  • 470
  • I had incorrect debug stops in the past, where they usually ended up in main as it did for you. It usually means that the problem was a memory issue, which only became a problem as the compiler found the screwed up memory--right about where it stopped in main. I'm not sure that it's really a fixable problem. – Daniel G. Wilson Nov 01 '11 at 22:20
  • 1
    Have you set a break point when exceptions are thrown this sometimes drops you to the right line – Paul.s Nov 01 '11 at 22:37
  • thanks, but the old behavior was way better. Xcode 4 is a hyper jump into mediocrity. – Duck Nov 01 '11 at 23:18
  • I've had similar problems -- the app will error out, but it won't show the line of code it errors on. This was never an issue before 4.2. – memmons Nov 02 '11 at 15:32
  • @Paul.s Thank you I had not done an iphone app in a while and the exception breakpoint was the crucial thing I forgot to do! In latest xcode just go to breakpoint navigator(command-6) and click + on the bottom. Whoops - this is an endorsed answer below but doesn't come to top for some reason. – Colin Dec 08 '12 at 13:52

2 Answers2

11

Go to the breakpoints panel, and add the bottom left, click the + sign and add an "Exception breakpoint".

Exceptions : All
Break : On throw.

That should solve the problem in most cases.

Oliver
  • 23,072
  • 33
  • 138
  • 230
0

I do not know how to reclaim the old behavior.

Zane Claes offers a great solution on a similar question here.

Xcode 4.2 debug doesn't symbolicate stack call

After you find what class your app is crashing in you can use the debugger to step through and find the culprit

Community
  • 1
  • 1
Jesse Black
  • 7,966
  • 3
  • 34
  • 45