[llvm] 724bf4e - [Symbolize][PDB] Switch llvm-symbolizer to use PDB_ReaderType::Native.

Amy Huang via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 17:18:15 PDT 2020


Author: Amy Huang
Date: 2020-07-22T17:17:57-07:00
New Revision: 724bf4ee23a3993689d55afb2845949e05c83b1c

URL: https://github.com/llvm/llvm-project/commit/724bf4ee23a3993689d55afb2845949e05c83b1c
DIFF: https://github.com/llvm/llvm-project/commit/724bf4ee23a3993689d55afb2845949e05c83b1c.diff

LOG: [Symbolize][PDB] Switch llvm-symbolizer to use PDB_ReaderType::Native.

Since native PDB reading has been implemented for symbolizing,
switch to using the native PDB reader by default, unless
LLVM_ENABLE_DIA_SDK is on.

Bug: https://bugs.llvm.org/show_bug.cgi?id=41795

Differential Revision: https://reviews.llvm.org/D84286

Added: 
    

Modified: 
    llvm/lib/DebugInfo/Symbolize/Symbolize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
index 1d767a2b0d88..383e2c0d3054 100644
--- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -16,6 +16,7 @@
 
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/BinaryFormat/COFF.h"
+#include "llvm/Config/config.h"
 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
 #include "llvm/DebugInfo/PDB/PDB.h"
 #include "llvm/DebugInfo/PDB/PDBContext.h"
@@ -555,9 +556,12 @@ LLVMSymbolizer::getOrCreateModuleInfo(const std::string &ModuleName) {
     if (!EC && DebugInfo != nullptr && !PDBFileName.empty()) {
       using namespace pdb;
       std::unique_ptr<IPDBSession> Session;
-      PDB_ReaderType ReaderType = Opts.UseNativePDBReader
-                                      ? PDB_ReaderType::Native
-                                      : PDB_ReaderType::DIA;
+
+      PDB_ReaderType ReaderType = PDB_ReaderType::Native;
+#if LLVM_ENABLE_DIA_SDK
+      if (!Opts.UseNativePDBReader)
+        ReaderType = PDB_ReaderType::DIA;
+#endif
       if (auto Err = loadDataForEXE(ReaderType, Objects.first->getFileName(),
                                     Session)) {
         Modules.emplace(ModuleName, std::unique_ptr<SymbolizableModule>());


        


More information about the llvm-commits mailing list