我刚刚开始在 Xcode 中进行 Cocoa 开发,正在做 hello world 示例。我已完成“runtime debugging”部分的第 6 步,即
Using the Step Over button in the debugger toolbar, begin stepping through the code. As each line of code executes, you can examine the program’s state. The value of a variable is sometimes drawn in red to indicate that the value was modified in the last step. Notice that the debugger pauses before executing the indicated line. After each pause, you can add additional breakpoints or choose Debug > Restart to terminate the application and start a new debugging session.
现在我在过去的一个小时里一直抓狂的是这个调试器只会向我显示汇编代码。我可以手动选择源代码文件,但是一旦单击“Step over”,我就会立即返回汇编器 View 。我怎么也想不出如何关闭汇编器,并让它显示我的源代码!
最佳答案
我知道这篇文章已经有一百年历史了,但是如果有人想知道如何在更新的 Xcode 版本(而不是 Xcode 3)中解决这个问题,您会找到标记为 Always Show 的适当设置Xcode 6 及更高版本中调试>调试工作流程下的反汇编。确保未选中该选项。
在 Xcode 5 中,该选项在调试>调试工作流程下标记为调试时显示反汇编。确保未选中“调试时显示反汇编”。
回到 Xcode 4,调试时显示反汇编设置位于产品>调试工作流程下。再次确保该选项保持未选中状态。
这也让我发疯。
注意:以上信息对于 Xcode 14+ 仍然有效。随着 Xcode 新版本的发布,我已对此答案进行了更新。幸运的是,自 Xcode 6(到目前为止)以来,该选项一直保持不变。
关于Xcode调试器: Why is it only showing me assembler?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1421093/