]> git.cworth.org Git - apitrace/blobdiff - common/trace_backtrace.cpp
d3dretrace: Dump textures of all shader stages.
[apitrace] / common / trace_backtrace.cpp
index 83c9d46e5e06f8d2d3e19390b152a10c97d8588b..ba2a3739a6082b48a03e036bd0f4976c23c56f55 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"
@@ -112,7 +112,7 @@ bool backtrace_is_needed(const char* fname) {
 
 } /* namespace trace */
 
-#ifdef ANDROID
+#if defined(ANDROID)
 
 #include <dlfcn.h>
 #include "os.hpp"
@@ -270,14 +270,15 @@ std::vector<RawStackFrame> get_backtrace() {
 }
 
 /* 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 {
 
@@ -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;
     }