[Lldb-commits] [PATCH] D110172: [lldb/win] Default to native PDB reader when building with LLVM_ENABLE_DIA_SDK=NO

Nico Weber via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 21 06:57:50 PDT 2021


thakis created this revision.
thakis added reviewers: labath, amccarth.
thakis added a project: LLDB.
Herald added a subscriber: JDevlieghere.
thakis requested review of this revision.

Trying to use the DIA SDK reader only to fail with "DIA SDK wasn't enabled"
isn't very useful. The native PDB reader is missing some stuff, but it's
still better than nothing.

Reduces number of lldb-check-shell test failures with LLVM_ENABLE_DIA_SDK=NO from
27 to 15.


https://reviews.llvm.org/D110172

Files:
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp


Index: lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
+++ lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
@@ -52,6 +52,10 @@
 #include "Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.h"
 #include "Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h"
 
+#if defined(_WIN32)
+#include "llvm/Config/config.h"
+#endif
+
 using namespace lldb;
 using namespace lldb_private;
 using namespace llvm::pdb;
@@ -83,6 +87,7 @@
 
 static bool ShouldUseNativeReader() {
 #if defined(_WIN32)
+#if LLVM_ENABLE_DIA_SDK
   llvm::StringRef use_native = ::getenv("LLDB_USE_NATIVE_PDB_READER");
   return use_native.equals_insensitive("on") ||
          use_native.equals_insensitive("yes") ||
@@ -91,6 +96,9 @@
 #else
   return true;
 #endif
+#else
+  return true;
+#endif
 }
 
 void SymbolFilePDB::Initialize() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110172.373906.patch
Type: text/x-patch
Size: 936 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210921/6461e140/attachment.bin>


More information about the lldb-commits mailing list