boostorg / stacktrace

C++ library for storing and printing backtraces.
https://boost.org/libs/stacktrace
433 stars 74 forks source link

can't write dump file on windows #56

Closed yokarno closed 6 years ago

yokarno commented 6 years ago

Hello: I write a test program and want to write dump file on windows, but it doesn't work, I think it has something wrong in my code, but I don't know why , can someone help me : my whole code, on Windows 10 ,VS2010 boost 1.67:

include

include <boost/stacktrace.hpp>

void my_signal_handler(int signum) { ::signal(signum, SIG_DFL); boost::stacktrace::safe_dump_to( "./backtrace.dump"); ::raise(SIGABRT); }

int main() { ::signal(SIGSEGV, &my_signal_handler); ::signal(SIGABRT, &my_signal_handler);

//do something; std::terminate(); }

is it some macro i missed ?

thanks.

apolukhin commented 6 years ago

I'm afraid that Windows is a platform that does not have functionality for getting async signal safe stacktarce.

Looks like I have to specify the supported platforms here: https://www.boost.org/doc/libs/1_67_0/doc/html/stacktrace/getting_started.html#stacktrace.getting_started.handle_terminates_aborts_and_seg

yokarno commented 6 years ago

unfortunately news, but thank you anyway.