【问题标题】:Missing stack trace in Xcode debugger when exception is thrown on both iOS simulator and device在 iOS 模拟器和设备上都引发异常时,Xcode 调试器中缺少堆栈跟踪
【发布时间】:2011-12-10 05:27:01
【问题描述】:

当我的应用抛出异常时,它会在调试器输出中打印以下内容:

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 错误,但您有没有发现我遗漏的任何明显内容?

我尝试过/检查过的内容

构建设置:
调试
在复制期间去除调试符号 = 否
剥离链接产品 = 否
优化级别 = -O0 和 -Os
默认隐藏的符号 = YES 和 NO
编译器 = LLVM 3.0 和 LLVM GCC 4.2

方案:
调试器 = GDB 和 LLDB

清洁:
清洁
清理构建文件夹
删除派生数据目录(从组织者中删除)

设备:
iOS 5 模拟器
iOS 5 iPhone 4
iOS 5 iPhone 3Gs

随机:
我最初在安装 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.

【问题讨论】:

    标签: iphone ios xcode debugging build


    【解决方案1】:

    唯一突出的是,开发版本可能应该使用-O0 完全关闭优化。

    【讨论】:

      【解决方案2】:

      好的,找到了问题:好吧,不是我,而是乔(phillyCocoa 成员)……但由于他不在 SO,我将发布他的解决方案。

      部署目标设置为 4.0,但由于 4.0 调试符号必须在 Xcode 4.2 中单独下载,因此 DSYM 无效。

      两种修复方法:
      1. 从 Xcode 首选项安装 4.0 的调试符号。
      2. 将部署目标设置为 4.3 或更高版本。

      【讨论】:

      • 在 Xcode 4.x 中,你是如何下载调试符号的? Preferences->Downloads 中没有这样的选项。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-08
      • 1970-01-01
      • 2020-05-16
      • 2011-12-12
      • 2021-09-28
      • 2011-01-05
      • 1970-01-01
      相关资源
      最近更新 更多