我怎么可以检查装配在X $ C $的C 4? [英] How can I examine assembly in Xcode 4?

查看:219
本文介绍了我怎么可以检查装配在X $ C $的C 4?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我调整,在紧密循环运行在我的iPhone应用程序的一些code,我很好奇,想看看生成的程序集code,看看是否有任何不寻常的。

I'm tuning some code that runs in a tight loop in my iPhone app and I'm curious to see the generated assembly code to see if anything looks out of the ordinary.

在第X code 3.x中,有一个的构建>显示大会code 的选项菜单中,但我没有看到任何菜单或文档X $ C $的C 4。

In Xcode 3.x, there was a Build > Show Assembly Code option in the menu, but I don't see anything in the menus or the documentation for Xcode 4.

任何人都知道如何做到这一点?我可以做的gcc -S,但我的理解是,这将不会是相同的,整个项目如何进行编译。

Anyone know how to do this? I could do "gcc -S" but my understanding is that that won't be identical to how the entire project is compiled.

推荐答案

视图拆卸选项消失了,据我可以告诉。

The "View Disassembly" option is gone, as far as I can tell.

这里有一个解决方法:


  1. 生成项目

  2. 打开生成日志,并使用搜索​​窗口中找到被用来构建你感兴趣的源文件编译命令,复制整个构建命令。

  3. 打开一个终端窗口,cd到你的项目目录。

  4. -save-临时工
  5. 粘贴从构建登录到终端构建命令,并追加。按Enter键。

  6. 您现在有两个新文件, yourFile.i yourFile.s ,这是preprocessed源和生成的汇编,分别建正是因为他们在你的项目中。

  1. Build your project
  2. Open the build log, and use the search window to find the compile command that was used to build the source file you're interested in. Copy the entire build command.
  3. Open a terminal window, and cd to your project directory.
  4. Paste the build command from the build log into the terminal, and append -save-temps. Hit enter.
  5. You now have two new files, yourFile.i and yourFile.s, which are the preprocessed source and generated assembly, respectively, built exactly as they are in your project.

另外,你可以拆卸内置二进制文件(或从源文件产生的目标文件)使用 otool -tvV /路径/要/ binaryOrDotOFile

Alternatively, you can disassemble the built binary (or the object file resulting from your source file) using otool -tvV /path/to/binaryOrDotOFile.

最后,如果这是你想有回功能,应确保提交的bug报告!

Finally, if this is a feature that you would like to have back, make sure to file a bug report!

编辑:
此功能是早在X $ C $ 4.1Ç。在助理编辑窗格中,选择生成的输出 - > YourFilename(组件)。轰!

This feature is back in Xcode 4.1. In the assistant editor pane, select "Generated Output -> YourFilename (Assembly)". Boom!

这篇关于我怎么可以检查装配在X $ C $的C 4?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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