#include <fcntl.h>
#include <errno.h>
#include <signal.h>
-#ifdef SENF_DEBUG
+#ifdef SENF_BACKTRACE
#include <execinfo.h>
#endif
#include <sstream>
if (sig == SIGSEGV)
std::cerr << "Invalid memory access at " << info->si_addr << "\n";
-
+#ifdef SENF_BACKTRACE
static void * entries[SENF_DEBUG_BACKTRACE_NUMCALLERS];
unsigned nEntries( ::backtrace(entries, SENF_DEBUG_BACKTRACE_NUMCALLERS) );
std::cerr << "Backtrace:\n";
senf::formatBacktrace(std::cerr, entries, nEntries);
std::cerr << "-- \n";
-
+#endif //SENF_BACKTRACE
if (sig != SIGUSR2) {
::signal(sig, SIG_DFL);
::kill(::getpid(), sig);
}
-#endif
+#endif // SENF_DEBUG
namespace {
void sighupHandler(int sig)