Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing stack trace in Xcode debugger when exception is thrown on both iOS simulator and device

When my app throws an exception it prints the following in the debugger output:

First throw call stack:
(0x310f88bf 0x3829d1e5 0x31e76015 0x31e7640d 0x31e764c5 0x9e903 0x9edfb 0x32b15d55 0x32b20e8d 0x310cb2dd 0x3104e4dd 0x3104e3a5 0x33c7cfed 0x330c0743 0x3267 0x3220)

Software stack:
Xcode 4.2 in Lion 10.7.2 (Xcode 4.1 is not installed)

I am leaning towards this this being an Xcode bug, but do you see anything obvious that I missed?

What I have tried / checked

Build Settings:
Debug
Strip Debug Symbols During Copy = NO
Strip Linked Product = NO
Optimization Level = -O0 and-Os
Symbols Hidden By Default = YES and NO
Compiler = LLVM 3.0 and LLVM GCC 4.2

Scheme:
Debugger = GDB and LLDB

Cleaning:
Clean
Clean Build Folder
Delete Derived Data Directory (remove from organizer)

Devices:
iOS 5 Simulator
iOS 5 iPhone 4
iOS 5 iPhone 3Gs

Random:
I originally had this problem with both Xcode 4.1 and 4.2 installed, so uninstalled both and reinstalled just 4.2

Tried with different projects with the same results.

When fiddling with breakpoints I see this in the debugger output before the exception:

Catchpoint 36 (throw)Catchpoint 37 (catch)Pending breakpoint 2 - "__cxa_begin_catch" resolved
warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame.
warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame.

Catchpoint 36 (exception thrown).warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame.
warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame.
like image 592
Corey Floyd Avatar asked Oct 18 '11 15:10

Corey Floyd


2 Answers

Ok, found the issue: Well not me but Joe (a phillyCocoa member)… But since he is not on SO, I will post his solution.

The deployment target was set to 4.0, but since the 4.0 debug symbols must be downloaded separately in Xcode 4.2, the DSYM wasn't valid.

2 ways to fix:
1. Install the debug symbols for 4.0 from the Xcode preferences.
2. Set the deployment target to 4.3 or higher.

like image 108
Corey Floyd Avatar answered Sep 19 '22 17:09

Corey Floyd


The only thing that sticks out is that development builds should probably have optimisation switched off altogether with -O0.

like image 44
Jim Avatar answered Sep 20 '22 17:09

Jim