如何跟踪 Xcode 程序崩溃的位置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10878035/
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-15 00:29:21  来源:igfitidea点击:

How to trace where Xcode program crash

objective-ciosxcode

提问by Jakub

I'm getting an error in debugger. In Thread my app crash on line:

我在调试器中遇到错误。在线程中,我的应用程序在线崩溃:

0x37265f78:  ldr    r3, [r4, #8]

with:

和:

Thread 1: EXC_BAD_ACCESS (code=1, address=0x50000008)

How to find out where app actually crash? There is a something like "call stack"?

如何找出应用程序实际崩溃的位置?有没有像“调用堆栈”这样的东西?

回答by Saurabh Passolia

You have to set Exception BreakpointGo to the Breakpoints navigator, click the + button at the bottom, and add an Exception Breakpoint. Now you will know the exact line where any of your exception will occur (e.g. line of crash). best of luck!!

您必须设置Exception BreakpointGo to the Breakpoints navigator,单击底部的 + 按钮,然后添加一个 Exception Breakpoint。现在您将知道任何异常将发生的确切行(例如崩溃行)。祝你好运!!

回答by sergio

Run your app under the debugger, then when your app crashes you will have access to the call stack.

在调试器下运行您的应用程序,然后当您的应用程序崩溃时,您将可以访问调用堆栈。

Furthermore, if you display the console window, you will get more textual information (including a call stack) at the moment of the crash.

此外,如果您显示控制台窗口,您将在崩溃时获得更多文本信息(包括调用堆栈)。

If you are using Xcode 4, have a look at the attached picture.enter image description here

如果您使用的是 Xcode 4,请查看所附图片。enter image description here