Line data Source code
1 0 : \cond NEVER 2 : Distributed under the MIT License. 3 : See LICENSE.txt for details. 4 : \endcond 5 : 6 : # Tips for debugging an executable {#runtime_errors} 7 : 8 : Learn how to use a debugger such as gdb. 9 : 10 : # Useful gdb commands 11 : 12 : - To break when an exception is thrown `catch throw` 13 : 14 : - To break on a specific exception type `catch throw std::out_of_range` 15 : (This may not work on all compilers or older versions of gdb. In this 16 : case you also try setting a breakpoint on the constructor of the exception 17 : type, `break std::out_of_range::out_of_range`) 18 : 19 : - SpECTRE has pretty printing facilities for various custom types. In order to 20 : enable these you must add 21 : `add-auto-load-safe-path /path/to/spectre/` to your `~/.gdbinit` file.