19 #ifndef ROSTLAB_STDEXCEPT
20 #define ROSTLAB_STDEXCEPT
33 std::string _backtrace;
37 const int bufsize = 64;
38 void* buffer[bufsize];
41 _backtrace.reserve(4096);
44 strings = backtrace_symbols(buffer, nptrs);
46 if (strings == NULL) { perror(
"backtrace_symbols"); exit(EXIT_FAILURE); }
48 for(
size_t j = 0; j < nptrs; ++j )
50 _backtrace += std::string( strings[j] ) +
"\n";
51 if( _backtrace.capacity() == _backtrace.size() ) _backtrace.reserve( _backtrace.size() * 2 );
58 virtual const std::string&
76 #endif // ROSTLAB_STDEXCEPT
virtual ~error_backtracer()
virtual const std::string & backtrace() const
runtime_error(const std::string &__msg)