#include <cxxabi.h>
#endif
-#if HAVE_BOOST_STACKTRACE
+#if HAVE_BOOST_STACKTRACE_BACKTRACE
#define BOOST_STACKTRACE_USE_BACKTRACE
#include <boost/stacktrace.hpp>
+#elif HAVE_BOOST_STACKTRACE_ADDR2LINE
+#define BOOST_STACKTRACE_USE_ADDR2LINE
+#include <boost/stacktrace.hpp>
#endif
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_backtrace, xbt, "Backtrace");
{
#ifdef __GXX_ABI_VERSION
int status;
- auto res = std::unique_ptr<char, std::function<void(char*)>>(abi::__cxa_demangle(name, nullptr, nullptr, &status),
- &std::free);
+ std::unique_ptr<char, std::function<void(char*)>> res(abi::__cxa_demangle(name, nullptr, nullptr, &status),
+ &std::free);
if (res != nullptr)
return res;
// We did not manage to resolve this. Probably because this is not a mangled symbol:
return false;
}
}
-#if HAVE_BOOST_STACKTRACE
+#if HAVE_BOOST_STACKTRACE_BACKTRACE || HAVE_BOOST_STACKTRACE_ADDR2LINE
boost::stacktrace::stacktrace st;
#endif
};
Backtrace::Backtrace()
{
-#if HAVE_BOOST_STACKTRACE
+#if HAVE_BOOST_STACKTRACE_BACKTRACE || HAVE_BOOST_STACKTRACE_ADDR2LINE
impl_ = new BacktraceImpl();
impl_->st = boost::stacktrace::stacktrace();
#endif
{
std::string result("");
-#if HAVE_BOOST_STACKTRACE
+#if HAVE_BOOST_STACKTRACE_BACKTRACE || HAVE_BOOST_STACKTRACE_ADDR2LINE
std::stringstream ss;
ss << impl_->st;
result.append(ss.str());