#ifndef IVBACKTRACE_H #define IVBACKTRACE_H #include //#define USE_BOOSTBACKTRACE //if USE_BOOSTBACKTRACE LIBS += -ldl LIBS += -lboost_system -lboost_filesystem -lbacktrace #if defined(IVBACKTRACE_LIBRARY) # define IVBACKTRACE_EXPORT Q_DECL_EXPORT #else # define IVBACKTRACE_EXPORT Q_DECL_IMPORT #endif #ifndef USE_BOOSTBACKTRACE void RegisterIVBackTrace(); #else #ifdef Q_OS_LINUX #ifndef BOOST_STACKTRACE_USE_BACKTRACE #define BOOST_STACKTRACE_USE_BACKTRACE #endif #endif #include #include #include #include #include // ::signal, ::raise // #include #include // std::logic_error #include // std::cerr #include #include #include #include #include #include /* size_t get_executable_path( char* processdir,char* processname, size_t len) { char* path_end; int nsize; if((nsize =readlink("/proc/self/exe", processdir,len)) <=0) return -1; processdir[nsize] = '\0'; path_end = strrchr(processdir, '/'); if(path_end == NULL) return -1; ++path_end; strcpy(processname, path_end); *path_end = '\0'; return (size_t)(path_end - processdir); } */ void x_signal_handler(int signum) { ::signal(signum, SIG_DFL); std::ostrstream ostr; ostr<