3 #include <boost/core/demangle.hpp>
5 #define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED
6 #include <boost/stacktrace.hpp>
24 std::cerr << boost::stacktrace::stacktrace();
29 ss << boost::stacktrace::stacktrace(1,1);
47 std::cerr << std::endl <<
"Catched SIGABRT " << signal <<
", exiting with " << (
last_assertion_code%256) << std::endl;
50 std::cerr <<
"Please check if this is the assertion that is actually thrown." << std::endl;
carl is the main namespace for the library.
std::string callingFunction()
std::string demangle(const char *name)
static bool signal_installed
Static variable that ensures that install_signal_handler is called.
int last_assertion_code
Stores an integer representation of the last assertion that was registered via REGISTER_ASSERT.
static void handle_signal(int signal)
Actual signal handler.
void printStacktrace()
Uses GDB to print a stack trace.
static bool install_signal_handler() noexcept
Installs the signal handler.
std::string last_assertion_string
Stores a textual representation of the last assertion that was registered via REGISTER_ASSERT.