Added constructor to frame that accepts function addresses

This commit is contained in:
Antony Polukhin
2017-05-06 10:17:38 +03:00
parent 576a5355e3
commit 77492bc517
2 changed files with 16 additions and 2 deletions

View File

@@ -11,8 +11,10 @@
#include <cstdlib> // std::exit
void print_signal_handler_and_exit() {
void* p = reinterpret_cast<void*>(::signal(SIGSEGV, SIG_DFL));
boost::stacktrace::frame f(p);
typedef void(*function_t)(int);
function_t old_signal_function = ::signal(SIGSEGV, SIG_DFL);
boost::stacktrace::frame f(old_signal_function);
std::cout << f << std::endl;
std::exit(0);
}