]> git.cworth.org Git - apitrace/blobdiff - common/trace_backtrace.cpp
Use libstdc++ demangler
[apitrace] / common / trace_backtrace.cpp
index 83c9d46e5e06f8d2d3e19390b152a10c97d8588b..a47ae9ea7faa0aafd63258d220e976d588404025 100644 (file)
@@ -276,6 +276,7 @@ std::vector<RawStackFrame> get_backtrace() {
 #include <dlfcn.h>
 #include <map>
 #include <vector>
+#include <cxxabi.h>
 
 #include "backtrace.h"
 
@@ -330,6 +331,9 @@ class libbacktraceProvider {
         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;
     }