9 #ifndef ALPS_UTILITY_NO_STACKTRACE 21 #ifndef ALPS_UTILITY_NO_STACKTRACE 26 std::ostringstream buffer;
30 buffer <<
" <empty, possibly corrupt>" << std::endl;
32 char * * symbols = backtrace_symbols(stack, depth);
33 for (std::size_t i = 1; i < depth; ++i) {
34 std::string symbol = symbols[i];
36 if (symbol.find_first_of(
' ', 59) != std::string::npos) {
37 std::string name = symbol.substr(59, symbol.find_first_of(
' ', 59) - 59);
39 char * demangled = abi::__cxa_demangle(name.c_str(), NULL, NULL, &status);
42 << symbol.substr(0, 59)
44 << symbol.substr(59 + name.size())
48 buffer <<
" " << symbol << std::endl;
50 buffer <<
" " << symbol << std::endl;