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

Amy Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 17:48:14 PDT 2020


akhuang created this revision.
akhuang added reviewers: hans, amccarth.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84286

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


Index: llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
===================================================================
--- llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ 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 @@
     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>());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84286.279680.patch
Type: text/x-patch
Size: 1186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200722/231d7f1b/attachment.bin>


More information about the llvm-commits mailing list