在 XCode 4(或 Xcode 5 或 Xcode 6)中查看反汇编

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5280462/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:27:30  来源:igfitidea点击:

View disassembly in XCode 4 (or Xcode 5 or Xcode 6)

xcodeassemblyxcode4xcode5

提问by Promit

I'm having trouble finding much in the way of information about the new XCode layout. How can I view the disassembly of my source file, rather than just the C++ code?

我很难找到有关新 XCode 布局的信息。如何查看源文件的反汇编,而不仅仅是 C++ 代码?

回答by OldPeculier

In Xcode 4.2 (and Xcode 5), you can see the assembly or disassembly for a file by:

在 Xcode 4.2(和 Xcode 5)中,您可以通过以下方式查看文件的汇编或反汇编:

  1. Showing the assistant editor (command+option+Enter is the default shortcut).
  2. In the JumpBar, select the tuxedo icon and select "Assembly" or "Disassembly" from the drop-down list.
  1. 显示辅助编辑器(command+option+Enter 是默认快捷方式)。
  2. 在 JumpBar 中,选择 tuxedo 图标并从下拉列表中选择“组装”或“拆卸”。

You can view the Assembly for a file whether or not you're running the application. Disassembly is only available when the application is running and being debugged.

无论您是否正在运行应用程序,您都可以查看文件的程序集。反汇编仅在应用程序运行和调试时可用。

回答by Jose Llausas

Follow these simple steps inside of Xcode:

在 Xcode 中执行以下简单步骤:

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

回答by Brian Richardson

You can also display disassembly by navigating to:

您还可以通过导航到以下位置来显示反汇编:

Debug->Debug Workflow->Show Disassemblywhile debugging.

Debug->Debug Workflow->Show Disassembly调试时。

This will display source and disassembly in the main window view.

这将在主窗口视图中显示源代码和反汇编。

回答by Hola Soy Edu Feliz Navidad

On Xcode 6 you can go to the menu "Debug -> Debug Workflow -> Always show disassembly".

在 Xcode 6 上,您可以转到菜单“调试 -> 调试工作流 -> 始终显示反汇编”。

回答by Laura

From what I read in a very thorough XCode 4 review (http://fireballed.org/linked/2011/03/09/xcode-pilkington/), the ability to show a file as assembly code is now gone in XCode 4. I guess you could always set a breakpoint in a method, and look at it disassembled in the debugger console with something like the "x/100i" command to treat print out the next 100 instructions in assembly, but that is a lot less convenient.

从我在非常详尽的 XCode 4 评论(http://fireballed.org/linked/2011/03/09/xcode-pilkington/)中读到的内容来看,将文件显示为汇编代码的能力现在在 XCode 4 中消失了。我想你总是可以在一个方法中设置一个断点,然后在调试器控制台中使用类似“x/100i”命令的东西来查看它的反汇编,以处理在汇编中打印出接下来的 100 条指令,但这不太方便。