Fix a couple of tests that were incorrectly using configuration.dwarf_version (#114161)

The tests were using the variable directly to get the dwarf version used
for the test. That's only the overridden value, and won't be set if
we're using the compiler default. I also put a comment by the variable
to make sure people don't make the same mistake in the future.
This commit is contained in:
jimingham
2024-10-30 09:25:47 -07:00
committed by GitHub
parent 6bf4476ffb
commit a575e6e5ca
3 changed files with 11 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ import lldb
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):
@@ -248,7 +248,7 @@ class TypeAndTypeListTestCase(TestBase):
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)