Xcode 4 Instruments 不显示源代码行 [英] Xcode 4 Instruments doesn't show source lines

查看:47
本文介绍了Xcode 4 Instruments 不显示源代码行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用 Xcode 4,发现无论我如何在项目中设置调试符号,Instruments 都拒绝显示与我的代码对应的堆栈跟踪项的源代码行.In 仅显示十六进制偏移量并将我的可执行文件标识为拥有模块.打开源位置"也会画一个空白.即使对于由 Xcode 生成的骨架 OpenGL ES 项目(文件 → 新建 → 新建项目... → iOS → 应用程序 → OpenGL ES 应用程序)也会发生这种情况.

I've just started playing with Xcode 4, and found that, no matter how I setup debugging symbols in the project, Instruments refuses to display source lines for stack trace items that correspond to my code. In only shows hex offsets and identifies my executable as the owning module. Turning on "Source Location" draws a blank too. This occurs even for the skeleton OpenGL ES project generated by Xcode (File → New → New Project... → iOS → Application → OpenGL ES Application).

这个问题只发生在 Instruments 中(到目前为止我已经尝试过 CPU 和 OpenGL 跟踪).Gdb 可以很好地提取调试符号.

This problem only occurs in Instruments (I've tried CPU and OpenGL tracing so far). Gdb picks up debug symbols just fine.

我是否必须做一些特殊的事情才能在 Instruments 中查看堆栈跟踪的源代码,或者这是 Xcode 4 中的错误?

Do I have to do something special to see the source code for stack traces in Instruments, or is this a bug in Xcode 4?

到目前为止,我已经:

  • 调试信息格式DWARF with dSYM File更改为DWARF.
  • 在复制期间剥离调试符号Yes更改为No.
  • 将构建方案更改为使用调试构建而不是使用仪器发布构建.

推荐答案

其他答案是很好的长期修复.如果您不想等待 Spotlight 重建其索引而只需要获取一个 Instruments 会话的符号,您可以要求 Instruments 对当前会话进行符号化.

The other answers are good long-term fixes. If you'd rather not wait for Spotlight to rebuild its index and just need to get symbols for one Instruments session, you can ask Instruments to symbolicate the current session.

  1. 选择文件 → 重新符号化文档...
  2. 在出现的列表中找到您的二进制文件.它应该与您在 Springboard 上看到的名称相同.选择您的二进制文件,然后单击定位".
  3. 返回 Xcode.按住 Control 键单击您的 .app 构建产品并选择在 Finder 中显示".
  4. 这将显示包含二进制文件的目录及其 dSYM 文件.返回 Instruments,导航到此目录,然后选择您的 dSYM 文件.最简单的方法是将 dSYM 文件直接从 Finder 拖到 Instruments 中的Select dSYM"对话框中.
  5. 最后,在 Instruments 中点击Symbolicate".您现在应该在跟踪中看到符号而不是十六进制偏移.
  1. Choose File → Re-Symbolicate Document…
  2. Locate your binary in the list that appears. It should be the same name you see on the Springboard. Select your binary and click "Locate."
  3. Go back to Xcode. Control-click on your .app build product and choose "Show in Finder".
  4. This will reveal the directory containing your binary as well as its dSYM file. Go back to Instruments, navigate to this directory, and select your dSYM file. The easiest way is to just drag the dSYM file straight from the Finder to the "Select dSYM" dialog in Instruments.
  5. Finally, click "Symbolicate" in Instruments. You should now see symbols in the traces rather than hex offsets.

这篇关于Xcode 4 Instruments 不显示源代码行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆