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

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

问题描述

这是来自brad larson的这个
的答案 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中,从顶级菜单中单击运行>显示>断点。弹出一个新窗口。

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

在左侧菜单中选择全局断点。 Breakpoint列下方右侧应有一个方框,文本为Double-Click for symbol。单击此框并键入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天全站免登陆