如何让QtCreator打破异常? [英] How can I make QtCreator break on exceptions?

查看:398
本文介绍了如何让QtCreator打破异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在QtCreator中调试一些BOOST单元测试,很遗憾,它们发生了异常而崩溃。如果发生任何异常,我如何使QtCreator自动中断?在Visual Studio中有一个这样的复选框,它也可以在QtCreator?



在我的情况下,BOOST捕获异常,所以程序不是技术上崩溃。



我在KDevelop之前尝试过相同的方法,因此我对这两个IDE提出了单独的问题。

解决方案


  • 打开调试模式(Ctrl + F4或右边第4模式)


  • 在右下角的断点列表中打开上下文菜单:




  • 选择添加断点并将断点类型设置为抛出C ++异常时断点:



    >



I am Debugging some BOOST unit tests in QtCreator and it sadly happened that they crash with an exception. How can I make QtCreator automagically break if any exception is raised? In Visual Studio there is a tick box for this one, is it also available in QtCreator?

In my case, BOOST catches the exception, so the program doesn't technically crash. However, the reported message is not really helpful.

I tried the same in KDevelop previuosly, hence I am asking separate questions about both of these IDEs.

解决方案

  • Open Debug mode (Ctrl+F4 or just 4th mode on right bar).

  • Open context menu in breakpoints list at right bottom:

  • Select "Add Breakpoint" and set the breakpoint type to "Break when C++ exception is thrown":

这篇关于如何让QtCreator打破异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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