Skip to content

[cherry-pick] Fix a couple of tests that were incorrectly using configuration.dwarf… #9506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lldb/packages/Python/lldbsuite/test/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
python = sys.executable

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

# Any overridden settings.
Expand Down
7 changes: 5 additions & 2 deletions lldb/test/API/lang/cpp/namespace/TestNamespaceLookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil

from lldbsuite.test import lldbplatformutil

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

# Continue to BP_ns_scope at ns scope
Expand Down
4 changes: 2 additions & 2 deletions lldb/test/API/python_api/type/TestTypeList.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil

from lldbsuite.test import lldbplatformutil

class TypeAndTypeListTestCase(TestBase):
def setUp(self):
Expand Down Expand Up @@ -248,7 +248,7 @@ def test(self):
self.assertEqual(myint_arr_element_type, myint_type)

# Test enum methods. Requires DW_AT_enum_class which was added in Dwarf 4.
if configuration.dwarf_version >= 4:
if int(lldbplatformutil.getDwarfVersion()) >= 4:
enum_type = target.FindFirstType("EnumType")
self.assertTrue(enum_type)
self.DebugSBType(enum_type)
Expand Down