| 1 |
// Pick your poison. |
| 2 |
// |
| 3 |
// On GNU/Linux, you have few choices to get the most out of your stack trace. |
| 4 |
// |
| 5 |
// By default you get: |
| 6 |
// - object filename |
| 7 |
// - function name |
| 8 |
// |
| 9 |
// In order to add: |
| 10 |
// - source filename |
| 11 |
// - line and column numbers |
| 12 |
// - source code snippet (assuming the file is accessible) |
| 13 |
|
| 14 |
// Install one of the following libraries then uncomment one of the macro (or |
| 15 |
// better, add the detection of the lib and the macro definition in your build |
| 16 |
// system) |
| 17 |
|
| 18 |
// - apt-get install libdw-dev ... |
| 19 |
// - g++/clang++ -ldw ... |
| 20 |
// #define BACKWARD_HAS_DW 1 |
| 21 |
|
| 22 |
// - apt-get install binutils-dev ... |
| 23 |
// - g++/clang++ -lbfd ... |
| 24 |
// #define BACKWARD_HAS_BFD 1 |
| 25 |
|
| 26 |
// - apt-get install libdwarf-dev ... |
| 27 |
// - g++/clang++ -ldwarf ... |
| 28 |
// #define BACKWARD_HAS_DWARF 1 |
| 29 |
|
| 30 |
// Regardless of the library you choose to read the debug information, |
| 31 |
// for potentially more detailed stack traces you can use libunwind |
| 32 |
// - apt-get install libunwind-dev |
| 33 |
// - g++/clang++ -lunwind |
| 34 |
// #define BACKWARD_HAS_LIBUNWIND 1 |
| 35 |
|
| 36 |
#include "../extern/backward/backward.hpp" |
| 37 |
|
| 38 |
namespace backward { |
| 39 |
|
| 40 |
backward::SignalHandling sh; |
| 41 |
|
| 42 |
} // namespace backward |