Skip to content

Commit e357b2d

Browse files
Nerixyzaokblast
authored andcommitted
[LLDB][PDB] Explicitly set DIA plugin in unit test (llvm#165592)
Fixes the failing DIA unit test (https://lab.llvm.org/buildbot/#/builders/197/builds/10342) after llvm#165363. Now that the native plugin is the default, we need to set the symbol file plugin for DIA via the settings.
1 parent 245b71c commit e357b2d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lldb/unittests/SymbolFile/PDB/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ add_lldb_unittest(SymbolFilePDBTests
99
lldbHost
1010
lldbSymbol
1111
lldbPluginObjectFilePECOFF
12+
lldbPluginPlatformWindows
1213
lldbPluginSymbolFileDWARF
1314
lldbPluginSymbolFilePDB
1415
lldbPluginTypeSystemClang

lldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
#include "llvm/Testing/Support/Error.h"
1717

1818
#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
19+
#include "Plugins/Platform/Windows/PlatformWindows.h"
1920
#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
2021
#include "Plugins/SymbolFile/PDB/SymbolFilePDB.h"
2122
#include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
2223
#include "TestingSupport/TestUtilities.h"
2324
#include "lldb/Core/Address.h"
25+
#include "lldb/Core/Debugger.h"
2426
#include "lldb/Core/Module.h"
2527
#include "lldb/Core/ModuleSpec.h"
2628
#include "lldb/Host/FileSystem.h"
@@ -59,6 +61,13 @@ class SymbolFilePDBTests : public testing::Test {
5961

6062
m_pdb_test_exe = GetInputFilePath("test-pdb.exe");
6163
m_types_test_exe = GetInputFilePath("test-pdb-types.exe");
64+
65+
ArchSpec arch("x86_64-pc-windows-msvc");
66+
Platform::SetHostPlatform(PlatformWindows::CreateInstance(true, &arch));
67+
m_debugger_sp = Debugger::CreateInstance();
68+
m_debugger_sp->SetPropertyValue(nullptr,
69+
lldb_private::eVarSetOperationAssign,
70+
"plugin.symbol-file.pdb.reader", "dia");
6271
}
6372

6473
void TearDown() override {
@@ -77,6 +86,7 @@ class SymbolFilePDBTests : public testing::Test {
7786
protected:
7887
std::string m_pdb_test_exe;
7988
std::string m_types_test_exe;
89+
lldb::DebuggerSP m_debugger_sp;
8090

8191
bool FileSpecMatchesAsBaseOrFull(const FileSpec &left,
8292
const FileSpec &right) const {

0 commit comments

Comments
 (0)