Reputation: 36639
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.
Upvotes: 45
Views: 10440
Reputation: 101
In QTcreator 8.0.2, this worked for me without adding any additional breakpoints:
Edit --> preferences --> Debugger --> GDB Extended --> Enable "Stop when aport() is called"
Upvotes: 0
Reputation: 1592
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":
Upvotes: 69