Author: Nico Weber Date: 2021-09-21T13:02:52-04:00 New Revision: 908c1154421287c6ffa0ef06ef5225a8fd0b06a7
URL: https://github.com/llvm/llvm-project/commit/908c1154421287c6ffa0ef06ef5225a8fd0b06a7 DIFF: https://github.com/llvm/llvm-project/commit/908c1154421287c6ffa0ef06ef5225a8fd0b06a7.diff LOG: [lldb/win] Default to native PDB reader when LLVM_ENABLE_DIA_SDK=NO 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. Differential Revision: https://reviews.llvm.org/D110172 Added: Modified: lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp Removed: ################################################################################ diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp index 794fab5f73095..be1c62c62006a 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ b/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,14 +87,16 @@ bool ShouldAddLine(uint32_t requested_line, uint32_t actual_line, 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") || - use_native.equals_insensitive("1") || - use_native.equals_insensitive("true"); -#else - return true; + if (!use_native.equals_insensitive("on") && + !use_native.equals_insensitive("yes") && + !use_native.equals_insensitive("1") && + !use_native.equals_insensitive("true")) + return false; +#endif #endif + return true; } void SymbolFilePDB::Initialize() { _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits