[PATCH] D12883: [llvm-symbolizer] Make --relative-address work with DWARF contexts

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 16:29:39 PDT 2015


rnk added inline comments.

================
Comment at: lib/Object/COFFObjectFile.cpp:274
@@ -276,6 +273,3 @@
   // return virtual addresses.
-  if (PE32Header)
-    Result += PE32Header->ImageBase;
-  else if (PE32PlusHeader)
-    Result += PE32PlusHeader->ImageBase;
+  Result += getImageBase().get();
   return Result;
----------------
samsonov wrote:
> What should you do if getImageBase() failed? Maybe, just add 0 in this case? Do we want to crash/assert in this case?
Hm, the test case says I need to return 0. =/ Awkward. I guess I'll preserve the existing behavior then.

================
Comment at: test/tools/llvm-symbolizer/coff-dwarf.test:2
@@ +1,3 @@
+RUN: llvm-symbolizer --inlining --relative-address -obj="%p/Inputs/coff-dwarf.exe" \
+RUN:	    < %p/Inputs/coff-dwarf.input | FileCheck %s
+
----------------
samsonov wrote:
> Is there no way to create the input file on the fly with "echo" commands on Windows, instead of storing the input in a separate file?
I don't think \n works in strings in lit's shell. I can use grep and sed though to cut down on files.

================
Comment at: test/tools/llvm-symbolizer/pdb/pdb.test:3
@@ -2,1 +2,3 @@
 RUN:    FileCheck %s --check-prefix=CHECK
+RUN: llvm-symbolizer -obj="%p/Inputs/test.exe" < "%p/Inputs/test.exe.input" | \
+RUN:    FileCheck %s --check-prefix=CHECK
----------------
samsonov wrote:
> Why do you need this copy here?
gone


http://reviews.llvm.org/D12883





More information about the llvm-commits mailing list