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.
You can use the Qt Creator debugger interface from the command line. To attach it to a running process, specify the process ID as a parameter for the -debug option. To examine a core file, specify the file name. Qt Creator executes all the necessary steps, such as searching for the binary that belongs to a core file.
There are several reasons why you might want to do your own build of Qt Creator, like using the most current development version and being able to tweak Qt Creator at one or the other place. It is also necessary if you want to create your own Qt Creator plugin. Prebuilt Qt Creator packages usually use the latest stable release of Qt.
That's very strange. if you run the program in the debugger, it will stop at the exception and show you the stack trace. If not, something is wrongly set up and you need to provide more info about your environment and setup. I presume you mean in Qt Creator.
To change the default settings, select View > Views, and then select views to display or hide. Alternatively, you can enable or disable views from the context menu of the title bar of any visible debugger view. You can drag and drop the views in Qt Creator to new positions on the screen. The size and position of views are saved for future sessions.
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":
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With