[PATCH] D44025: [llvm-symbolizer] Use correct path when resolving .gnu_debuglink in .debug

Francis Ricci via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 2 15:00:34 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL326630: [llvm-symbolizer] Use correct path when resolving .gnu_debuglink in .debug (authored by fjricci, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D44025

Files:
  llvm/trunk/lib/DebugInfo/Symbolize/Symbolize.cpp
  llvm/trunk/test/tools/llvm-symbolizer/split-debug.test


Index: llvm/trunk/lib/DebugInfo/Symbolize/Symbolize.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ llvm/trunk/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -185,7 +185,7 @@
     return true;
   }
   // Try /path/to/original_binary/.debug/debuglink_name
-  DebugPath = OrigRealPath;
+  DebugPath = OrigDir;
   llvm::sys::path::append(DebugPath, ".debug", DebuglinkName);
   if (checkFileCRC(DebugPath, CRCHash)) {
     Result = DebugPath.str();
Index: llvm/trunk/test/tools/llvm-symbolizer/split-debug.test
===================================================================
--- llvm/trunk/test/tools/llvm-symbolizer/split-debug.test
+++ llvm/trunk/test/tools/llvm-symbolizer/split-debug.test
@@ -0,0 +1,26 @@
+#Source:
+##include <stdio.h>
+#static inline int inctwo (int *a) {
+#  printf ("%d\n",(*a)++);
+#  return (*a)++;
+#}
+#static inline int inc (int *a) {
+#  printf ("%d\n",inctwo(a));
+#  return (*a)++;
+#}
+#
+#
+#int main () {
+#  int x = 1;
+#  return inc(&x);
+#}
+#
+#Build as : clang -g -O2 addr.c
+
+RUN: mkdir -p %t/.debug
+RUN: llvm-objcopy --keep=.debug_info %p/Inputs/addr.exe %t/.debug/addr
+RUN: llvm-objcopy --strip-debug --add-gnu-debuglink=%t/.debug/addr %p/Inputs/addr.exe %t/addr.exe
+RUN: llvm-symbolizer -print-address -obj=%t/addr.exe < %p/Inputs/addr.inp | FileCheck %s
+
+#CHECK: 0x40054d
+#CHECK: {{[/\]+}}tmp{{[/\]+}}x.c:14:0


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44025.136859.patch
Type: text/x-patch
Size: 1439 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180302/94472d95/attachment.bin>


More information about the llvm-commits mailing list