异常断点(相当于gdb的catch throw) [英] Breakpoint on exceptions (equivalent of gdb's catch throw)

查看:285
本文介绍了异常断点(相当于gdb的catch throw)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用lldb进行c ++调试,如果抛出异常,我想停止,如gdb的 catch throw ,我在lldb中找不到一个等价物文档。

解决方案

在Xcode中,您可以设置一个Exception断点(View> Navigators> Show Breakpoint Navigator,点击+断点列表窗口的底部添加一个新的断点)。



如果使用命令行lldb,在 __ cxa_throw 对于C ++异常throws, objc_exception_throw 为Objective-C异常throws。



对于所有c ++例外: break set -E C ++


I am trying to use lldb for c++ debugging and I want to halt if an exception is thrown, like gdb's catch throw, and I cannot find an equivalent in the lldb documentation.

解决方案

In Xcode, you can set an Exception breakpoint (View > Navigators > Show Breakpoint Navigator, hit the + button in the bottom of the breakpoint list window to add a new breakpoint).

If you're using command line lldb, put a breakpoint on __cxa_throw for C++ exception throws, objc_exception_throw for Objective-C exception throws.

For all c++ exceptions: break set -E C++.

这篇关于异常断点(相当于gdb的catch throw)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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