]> git.cworth.org Git - apitrace/blobdiff - common/trace_backtrace.cpp
WGL: Support float-based attrib_list parameters.
[apitrace] / common / trace_backtrace.cpp
index 83c9d46e5e06f8d2d3e19390b152a10c97d8588b..5cd30c93e47e7bee16e2acd3b8b59db2ad706026 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "trace_backtrace.hpp"
 
-#if defined(ANDROID) or defined(__ELF__)
+#if defined(ANDROID) || defined(__ELF__)
 
 #include <set>
 #include "os.hpp"
@@ -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;
     }