How can I make QtCreator break on exceptions?

2019-04-03 01:36发布

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.

1条回答
我只想做你的唯一
2楼-- · 2019-04-03 02:38
  • Open Debug mode (Ctrl+F4 or just 4th mode on right bar).

    enter image description here

  • Open context menu in breakpoints list at right bottom:

    enter image description here

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

    enter image description here

查看更多
登录 后发表回答