我怎么可以检查装配在X $ C $的C 4? [英] How can I examine assembly in Xcode 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.
这里有一个解决方法:
- 生成项目
- 打开生成日志,并使用搜索窗口中找到被用来构建你感兴趣的源文件编译命令,复制整个构建命令。
- 打开一个终端窗口,cd到你的项目目录。
- 粘贴从构建登录到终端构建命令,并追加。按Enter键。
- 您现在有两个新文件,
yourFile.i
和yourFile.s
,这是preprocessed源和生成的汇编,分别建正是因为他们在你的项目中。
-save-临时工
- Build your project
- 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.
- Open a terminal window, and cd to your project directory.
- Paste the build command from the build log into the terminal, and append
-save-temps
. Hit enter. - You now have two new files,
yourFile.i
andyourFile.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屋!