DebugPrinter header-only lib.
Creates a static object named
dout
and defines debugging macros.
DebugPrinter requires C++14.
Link with -rdynamic
in order to get proper stack()
frame names and useful dout_FUNC
output.
Note: compiler optimisations may inline functions (shorter stack).
Pass DEBUGPRINTER_OFF
to turn off all functionality provided here. The debug statements can be left in the code, since all methods and macros become inline and trivial, and thus will be optimised away by the compiler at sufficient optimisation flags. This flag will be automatically assumed if the standard NDEBUG
is passed.
Pass DEBUGPRINTER_NO_EXECINFO
flag on Windows (makes stack()
, dout_STACK
and dout_FUNC
trivial).
Pass DEBUGPRINTER_NO_CXXABI
if you don't have a cxxabi demangle call in your libc distribution (this translates raw type symbols, i.e. the typeid(std::string).name()
output Ss
to std::string
). The stack and type methods will then print the mangled names and a c++filt
-ready output.
Pass DEBUGPRINTER_NO_SIGNALS
to turn off automatic stack tracing when certain fatal signals occur. Passing this flag is recommended on non-Unix-like systems.
For details, consult the Member Function Documentation of fsc::DebugPrinter, the Macros section of DebugPrinter.hpp, as well as the Examples.
In case the program terminates with SIGSEGV
, SIGSYS
, SIGABRT
or SIGFPE
, you will automatically get a stack trace from the raise location. To turn off this behaviour, check the Compilation section.