Fix data symbolization with libbacktrace. Patch by Jakub Jelinek!
authorAlexey Samsonov <vonosmas@gmail.com>
Tue, 16 Dec 2014 01:52:55 +0000 (01:52 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Tue, 16 Dec 2014 01:52:55 +0000 (01:52 +0000)
llvm-svn: 224308

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.h
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc

index bb8ba6b..9317a78 100644 (file)
@@ -173,9 +173,9 @@ SymbolizedStack *LibbacktraceSymbolizer::SymbolizeCode(uptr addr,
   return data.first;
 }
 
-bool LibbacktraceSymbolizer::SymbolizeData(DataInfo *info) {
-  backtrace_syminfo((backtrace_state *)state_, info->address,
-                    SymbolizeDataCallback, ErrorCallback, info);
+bool LibbacktraceSymbolizer::SymbolizeData(uptr addr, DataInfo *info) {
+  backtrace_syminfo((backtrace_state *)state_, addr, SymbolizeDataCallback,
+                    ErrorCallback, info);
   return true;
 }
 
@@ -192,7 +192,7 @@ SymbolizedStack *LibbacktraceSymbolizer::SymbolizeCode(uptr addr,
   return nullptr;
 }
 
-bool LibbacktraceSymbolizer::SymbolizeData(DataInfo *info) {
+bool LibbacktraceSymbolizer::SymbolizeData(uptr addr, DataInfo *info) {
   return false;
 }
 
index a335cb2..1ff0050 100644 (file)
@@ -35,7 +35,7 @@ class LibbacktraceSymbolizer {
   SymbolizedStack *SymbolizeCode(uptr addr, const char *module_name,
                                  uptr module_offset);
 
-  bool SymbolizeData(DataInfo *info);
+  bool SymbolizeData(uptr addr, DataInfo *info);
 
   // May return NULL if demangling failed.
   static char *Demangle(const char *name, bool always_alloc = false);
index d46c249..69ac18e 100644 (file)
@@ -596,7 +596,7 @@ class POSIXSymbolizer : public Symbolizer {
     // First, try to use libbacktrace symbolizer (if it's available).
     if (libbacktrace_symbolizer_ != 0) {
       mu_.CheckLocked();
-      if (libbacktrace_symbolizer_->SymbolizeData(info))
+      if (libbacktrace_symbolizer_->SymbolizeData(addr, info))
         return true;
     }
     const char *str = SendCommand(true, module_name, module_offset);