如何向 objc_exception_throw 添加断点? [英] How to add a breakpoint to objc_exception_throw?

查看:22
本文介绍了如何向 objc_exception_throw 添加断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是布拉德·拉森对此的回答SO 问题

this was the answer from the brad larson on this SO question

如果添加两个断点,应该可以调试这些异常.为此,请转到运行 |显示 |断点并创建两个全局断点(我全局执行它们,因为它们在我的所有应用程序中都非常有用).第一个应命名为objc_exception_throw",其位置应为libobjc.A.dylib".第二个应该是-[NSException raise]",它的位置应该是CoreFoundation".

If you add two breakpoints, you should be able to debug these exceptions. To do this, go to Run | Show | Breakpoints and create two global breakpoints (I do them globally because they are so useful in all my applications). The first should be named "objc_exception_throw" and its location should be "libobjc.A.dylib". The second should be "-[NSException raise]" and its location should be "CoreFoundation".

现在,如果您在启用断点的情况下开始调试您的应用程序,它应该会在抛出这些异常时中断.然后,您应该能够在调试器中看到导致异常的事件链.

Now, if you start debugging your application with breakpoints enabled, it should break on the throw of these exceptions. You should then be able to see the chain of events that led to the exception within the debugger.

现在在这个答案中我想问我如何添加提到的位置???

now in this answer i want to ask how do i add location mentioned???

推荐答案

我认为 Brad 的回答很清楚;如果您不清楚,希望这会有所帮助.

I think Brad's answer is pretty clear; hopefully this can help if you're not finding it clear.

在 Xcode 中,从顶部菜单中单击 Run > Show > Breakpoints.弹出一个新窗口.

In Xcode, from the top menu click on Run > Show > Breakpoints. A new window pops up.

在左侧菜单中选择全局断点".在断点"列下的右侧应该有一个框,其中包含双击符号"文本.单击此框并输入objc_exception_throw".

Select "global breakpoints" in the left hand menu. There should be a box on the right under the "Breakpoint" column with the text "Double-Click for symbol". Single-click in this box and type in "objc_exception_throw".

然后,单击位置"列下objc_exception_throw"旁边的空间.将出现一个框供您输入位置(在本例中为libobjc.A.dylib").我做了一个截图,希望能有所帮助:

Then, single-click in the space next to "objc_exception_throw" under the "location" column. A box will appear for you to type in the location (in this case, "libobjc.A.dylib"). I've made a screenshot that will hopefully help:

这篇关于如何向 objc_exception_throw 添加断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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