Skip to content

Commit 724bf4e

Browse files
committed
[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
1 parent 8acaceb commit 724bf4e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

llvm/lib/DebugInfo/Symbolize/Symbolize.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "llvm/ADT/STLExtras.h"
1818
#include "llvm/BinaryFormat/COFF.h"
19+
#include "llvm/Config/config.h"
1920
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
2021
#include "llvm/DebugInfo/PDB/PDB.h"
2122
#include "llvm/DebugInfo/PDB/PDBContext.h"
@@ -555,9 +556,12 @@ LLVMSymbolizer::getOrCreateModuleInfo(const std::string &ModuleName) {
555556
if (!EC && DebugInfo != nullptr && !PDBFileName.empty()) {
556557
using namespace pdb;
557558
std::unique_ptr<IPDBSession> Session;
558-
PDB_ReaderType ReaderType = Opts.UseNativePDBReader
559-
? PDB_ReaderType::Native
560-
: PDB_ReaderType::DIA;
559+
560+
PDB_ReaderType ReaderType = PDB_ReaderType::Native;
561+
#if LLVM_ENABLE_DIA_SDK
562+
if (!Opts.UseNativePDBReader)
563+
ReaderType = PDB_ReaderType::DIA;
564+
#endif
561565
if (auto Err = loadDataForEXE(ReaderType, Objects.first->getFileName(),
562566
Session)) {
563567
Modules.emplace(ModuleName, std::unique_ptr<SymbolizableModule>());

0 commit comments

Comments
 (0)