You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

backward.cpp 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. // Install one of the following libraries then uncomment one of the macro (or
  14. // better, add the detection of the lib and the macro definition in your build
  15. // system)
  16. // - apt-get install libdw-dev ...
  17. // - g++/clang++ -ldw ...
  18. // #define BACKWARD_HAS_DW 1
  19. // - apt-get install binutils-dev ...
  20. // - g++/clang++ -lbfd ...
  21. // #define BACKWARD_HAS_BFD 1
  22. // - apt-get install libdwarf-dev ...
  23. // - g++/clang++ -ldwarf ...
  24. // #define BACKWARD_HAS_DWARF 1
  25. // Regardless of the library you choose to read the debug information,
  26. // for potentially more detailed stack traces you can use libunwind
  27. // - apt-get install libunwind-dev
  28. // - g++/clang++ -lunwind
  29. // #define BACKWARD_HAS_LIBUNWIND 1
  30. #include "backward.hpp"
  31. namespace backward {
  32. backward::SignalHandling sh;
  33. } // namespace backward