#include "trace_backtrace.hpp"
-#if defined(ANDROID) or defined(__ELF__)
+#if defined(ANDROID) || defined(__ELF__)
#include <set>
#include "os.hpp"
} /* namespace trace */
-#ifdef ANDROID
+#if defined(ANDROID)
#include <dlfcn.h>
#include "os.hpp"
}
/* end ANDROID */
-#elif defined __linux__
+#elif defined(__ELF__)
#include <stdint.h>
#include <dlfcn.h>
#include <map>
#include <vector>
+#include <cxxabi.h>
-#include "backtrace.h"
+#include <backtrace.h>
namespace trace {
frame.linenumber = line;
if (func)
frame.function = func;
+ int status;
+ if (func && (func = abi::__cxa_demangle(func, NULL, NULL, &status)))
+ frame.function = func;
this_->current_frames->push_back(frame);
return 0;
}