Skip to content

Commit 82d13d3

Browse files
committed
fix: use single pdb debug info option
1 parent a518056 commit 82d13d3

File tree

6 files changed

+17
-44
lines changed

6 files changed

+17
-44
lines changed

lldb/packages/Python/lldbsuite/test/builders/builder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ def _getDebugInfoArgs(self, debug_info):
258258
"gmodules": {"MAKE_DSYM": "NO", "MAKE_GMODULES": "YES"},
259259
"debug_names": {"MAKE_DEBUG_NAMES": "YES"},
260260
"dwp": {"MAKE_DSYM": "NO", "MAKE_DWP": "YES"},
261-
"native-pdb": {"DEBUG_INFO_FLAG": "-g"},
262-
"dia-pdb": {"DEBUG_INFO_FLAG": "-g"},
261+
"pdb": {"DEBUG_INFO_FLAG": "-g"},
263262
}
264263

265264
# Collect all flags, with later options overriding earlier ones

lldb/packages/Python/lldbsuite/test/lldbtest.py

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -804,13 +804,6 @@ def setUpCommands(cls):
804804
)
805805
return commands
806806

807-
def getDebugInfoSetupCommands(self):
808-
if self.getDebugInfo() == "native-pdb":
809-
return ["settings set plugin.symbol-file.pdb.reader native"]
810-
if self.getDebugInfo() == "dia-pdb":
811-
return ["settings set plugin.symbol-file.pdb.reader dia"]
812-
return []
813-
814807
def setUp(self):
815808
"""Fixture for unittest test case setup.
816809
@@ -835,6 +828,13 @@ def setUp(self):
835828
else:
836829
self.lldbDAPExec = None
837830

831+
self.lldbOption = " ".join("-o '" + s + "'" for s in self.setUpCommands())
832+
833+
# If we spawn an lldb process for test (via pexpect), do not load the
834+
# init file unless told otherwise.
835+
if os.environ.get("NO_LLDBINIT") != "NO":
836+
self.lldbOption += " --no-lldbinit"
837+
838838
# Assign the test method name to self.testMethodName.
839839
#
840840
# For an example of the use of this attribute, look at test/types dir.
@@ -843,14 +843,6 @@ def setUp(self):
843843
# used for all the test cases.
844844
self.testMethodName = self._testMethodName
845845

846-
setUpCommands = self.setUpCommands() + self.getDebugInfoSetupCommands()
847-
self.lldbOption = " ".join("-o '" + s + "'" for s in setUpCommands)
848-
849-
# If we spawn an lldb process for test (via pexpect), do not load the
850-
# init file unless told otherwise.
851-
if os.environ.get("NO_LLDBINIT") != "NO":
852-
self.lldbOption += " --no-lldbinit"
853-
854846
# This is for the case of directly spawning 'lldb'/'gdb' and interacting
855847
# with it using pexpect.
856848
self.child = None
@@ -1803,8 +1795,7 @@ def no_reason(_):
18031795
# PDB is off by default, because it has a lot of failures right now.
18041796
# See llvm.org/pr149498
18051797
if original_testcase.TEST_WITH_PDB_DEBUG_INFO:
1806-
dbginfo_categories.append("native-pdb")
1807-
dbginfo_categories.append("dia-pdb")
1798+
dbginfo_categories.append("pdb")
18081799

18091800
xfail_for_debug_info_cat_fn = getattr(
18101801
attrvalue, "__xfail_for_debug_info_cat_fn__", no_reason
@@ -1895,9 +1886,8 @@ class TestBase(Base, metaclass=LLDBTestCaseFactory):
18951886

18961887
TEST_WITH_PDB_DEBUG_INFO = False
18971888
"""
1898-
Subclasses can set this to True to test with both native and DIA PDB in addition to
1899-
the other debug info types. This id off by default because many tests will
1900-
fail due to missing functionality in PDB.
1889+
Subclasses can set this to True to test with PDB in addition to the other debug info
1890+
types. This id off by default because many tests will fail due to missing functionality in PDB.
19011891
See llvm.org/pr149498.
19021892
"""
19031893

@@ -1940,8 +1930,6 @@ def setUp(self):
19401930

19411931
for s in self.setUpCommands():
19421932
self.runCmd(s)
1943-
for s in self.getDebugInfoSetupCommands():
1944-
self.runCmd(s)
19451933

19461934
# We want our debugger to be synchronous.
19471935
self.dbg.SetAsync(False)
@@ -2288,9 +2276,7 @@ def completions_match(self, command, completions, max_completions=-1):
22882276
given list of completions"""
22892277
interp = self.dbg.GetCommandInterpreter()
22902278
match_strings = lldb.SBStringList()
2291-
interp.HandleCompletion(
2292-
command, len(command), 0, max_completions, match_strings
2293-
)
2279+
interp.HandleCompletion(command, len(command), 0, max_completions, match_strings)
22942280
# match_strings is a 1-indexed list, so we have to slice...
22952281
self.assertCountEqual(
22962282
completions, list(match_strings)[1:], "List of returned completion is wrong"

lldb/packages/Python/lldbsuite/test/test_categories.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
# System modules
66
import sys
7-
import os
87

98
# Third-party modules
109

@@ -17,8 +16,7 @@
1716
"dwarf": True,
1817
"dwo": True,
1918
"dsym": True,
20-
"native-pdb": False,
21-
"dia-pdb": False,
19+
"pdb": False,
2220
"gmodules": False,
2321
}
2422

@@ -27,7 +25,6 @@
2725
"cmdline": "Tests related to the LLDB command-line interface",
2826
"dataformatters": "Tests related to the type command and the data formatters subsystem",
2927
"debugserver": "Debugserver tests",
30-
"dia-pdb": "Tests that can be run with PDB debug information using the DIA PDB plugin",
3128
"dsym": "Tests that can be run with DSYM debug information",
3229
"dwarf": "Tests that can be run with DWARF debug information",
3330
"dwo": "Tests that can be run with DWO debug information",
@@ -43,7 +40,7 @@
4340
"lldb-dap": "Tests for the Debug Adapter Protocol with lldb-dap",
4441
"llgs": "Tests for the gdb-server functionality of lldb-server",
4542
"msvcstl": "Test for MSVC STL data formatters",
46-
"native-pdb": "Tests that can be run with PDB debug information using the native PDB plugin",
43+
"pdb": "Tests that can be run with PDB debug information",
4744
"pexpect": "Tests requiring the pexpect library to be available",
4845
"objc": "Tests related to the Objective-C programming language support",
4946
"pyapi": "Tests related to the Python API",
@@ -75,10 +72,8 @@ def is_supported_on_platform(category, platform, compiler_path):
7572
if platform not in ["darwin", "macosx", "ios", "watchos", "tvos", "bridgeos"]:
7673
return False
7774
return gmodules.is_compiler_clang_with_gmodules(compiler_path)
78-
elif category == "native-pdb":
75+
elif category == "pdb":
7976
return platform == "windows"
80-
elif category == "dia-pdb":
81-
return os.environ.get("LLVM_ENABLE_DIA_SDK", None) == "1"
8277
return True
8378

8479

lldb/test/API/lit.cfg.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,6 @@ def delete_module_cache(path):
349349
for v in ["SystemDrive"]:
350350
if v in os.environ:
351351
config.environment[v] = os.environ[v]
352-
if config.llvm_enable_dia_sdk:
353-
config.environment["LLVM_ENABLE_DIA_SDK"] = "1"
354352

355353
# Some steps required to initialize the tests dynamically link with python.dll
356354
# and need to know the location of the Python libraries. This ensures that we

lldb/test/API/lit.site.cfg.py.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
@LIT_SITE_CFG_IN_HEADER@
22

3-
import lit.util
4-
53
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
64
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
75
config.llvm_tools_dir = lit_config.substitute("@LLVM_TOOLS_DIR@")
86
config.llvm_libs_dir = lit_config.substitute("@LLVM_LIBS_DIR@")
97
config.llvm_include_dir = lit_config.substitute("@LLVM_INCLUDE_DIR@")
108
config.llvm_shlib_dir = lit_config.substitute("@SHLIBDIR@")
119
config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@")
12-
config.llvm_enable_dia_sdk = lit.util.pythonize_bool("@LLVM_ENABLE_DIA_SDK@")
1310
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
1411
config.lldb_obj_root = lit_config.substitute("@LLDB_BINARY_DIR@")
1512
config.lldb_src_root = "@LLDB_SOURCE_DIR@"

lldb/test/API/test_utils/pdb/TestPdb.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ class TestBuildMethod(TestBase):
1212
def test(self):
1313
self.build()
1414
self.assertTrue(self.dbg.CreateTarget(self.getBuildArtifact()))
15-
if self.getDebugInfo() == "native-pdb":
15+
if self.getDebugInfo() == "pdb":
1616
self.expect(
17-
"target modules dump symfile", substrs=["SymbolFile native-pdb"]
17+
"target modules dump symfile", patterns=["SymbolFile (native-)?pdb"]
1818
)
19-
if self.getDebugInfo() == "dia-pdb":
20-
self.expect("target modules dump symfile", substrs=["SymbolFile pdb"])

0 commit comments

Comments
 (0)