Skip to content

Commit 8a51690

Browse files
Merge pull request #9506 from felipepiovezan/felipe/cherry_pick_namespacelookup_test_fix
[cherry-pick] Fix a couple of tests that were incorrectly using configuration.dwarf…
2 parents 240db8d + ef777e9 commit 8a51690

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
python = sys.executable
5353

5454
# The overriden dwarf verison.
55+
# Don't use this to test the current compiler's
56+
# DWARF version, as this won't be set if the
57+
# version isn't overridden.
58+
# Use lldbplatformutils.getDwarfVersion() instead.
5559
dwarf_version = 0
5660

5761
# Any overridden settings.

lldb/test/API/lang/cpp/namespace/TestNamespaceLookup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from lldbsuite.test.decorators import *
99
from lldbsuite.test.lldbtest import *
1010
from lldbsuite.test import lldbutil
11-
11+
from lldbsuite.test import lldbplatformutil
1212

1313
class NamespaceLookupTestCase(TestBase):
1414
def setUp(self):
@@ -167,7 +167,10 @@ def test_scope_lookup_with_run_command(self):
167167
self.runToBkpt("continue")
168168
# FIXME: In DWARF 5 with dsyms, the ordering of functions is slightly
169169
# different, which also hits the same issues mentioned previously.
170-
if configuration.dwarf_version <= 4 or self.getDebugInfo() == "dwarf":
170+
if (
171+
int(lldbplatformutil.getDwarfVersion()) <= 4
172+
or self.getDebugInfo() == "dwarf"
173+
):
171174
self.expect_expr("func()", result_type="int", result_value="2")
172175

173176
# Continue to BP_ns_scope at ns scope

lldb/test/API/python_api/type/TestTypeList.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from lldbsuite.test.decorators import *
77
from lldbsuite.test.lldbtest import *
88
from lldbsuite.test import lldbutil
9-
9+
from lldbsuite.test import lldbplatformutil
1010

1111
class TypeAndTypeListTestCase(TestBase):
1212
def setUp(self):
@@ -248,7 +248,7 @@ def test(self):
248248
self.assertEqual(myint_arr_element_type, myint_type)
249249

250250
# Test enum methods. Requires DW_AT_enum_class which was added in Dwarf 4.
251-
if configuration.dwarf_version >= 4:
251+
if int(lldbplatformutil.getDwarfVersion()) >= 4:
252252
enum_type = target.FindFirstType("EnumType")
253253
self.assertTrue(enum_type)
254254
self.DebugSBType(enum_type)

0 commit comments

Comments
 (0)