当 iOS 模拟器和设备上抛出异常时,Xcode 调试器中缺少堆栈跟踪
当我的应用程序引发异常时,它会在调试器输出中打印以下内容:
First throw call stack:
(0x310f88bf 0x3829d1e5 0x31e76015 0x31e7640d 0x31e764c5 0x9e903 0x9edfb 0x32b15d55 0x32b20e8d 0x310cb2dd 0x3104e4dd 0x3104e3a5 0x33c7cfed 0x330c0743 0x3267 0x3220)
软件堆栈:
Lion 10.7.2 中的 Xcode 4.2(未安装 Xcode 4.1)
我倾向于这是一个 Xcode 错误,但是您是否看到我错过的任何明显内容?
我尝试过/检查过的
构建设置:
调试
在复制期间去除调试符号 = NO
条带连接产品 = 否
优化级别 = -O0 和 -Os
默认隐藏的符号 = YES 和 NO
编译器 = LLVM 3.0 和 LLVM GCC 4.2
方案:
调试器 = GDB 和 LLDB
清理:
干净
清理构建文件夹
删除派生数据目录(从管理器中删除)
设备:
iOS 5 模拟器
iOS 5 iPhone 4
iOS 5 iPhone 3G
随机:
我最初在安装 Xcode 4.1 和 4.2 时都遇到了这个问题,因此卸载了两者并重新安装了 4.2
尝试使用不同的项目获得相同的结果。
当摆弄断点时,我在异常之前的调试器输出中看到了这一点:
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.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,发现了问题:好吧,不是我,而是乔(phillyCocoa 成员)......但由于他不在 SO,我会发布他的解决方案。
部署目标设置为 4.0,但由于 4.0 调试符号必须在 Xcode 4.2 中单独下载,因此 DSYM 无效。
2 种修复方法:
1. 从 Xcode 首选项安装 4.0 的调试符号。
2. 将部署目标设置为 4.3 或更高版本。
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.
唯一突出的是开发版本可能应该使用
-O0
完全关闭优化。The only thing that sticks out is that development builds should probably have optimisation switched off altogether with
-O0
.