The architectures provided to skipIf / expectedFail are regular expressions (v. _match_decorator_property() in decorators.py so on Darwin systems "arm64" would match the skips for "arm" (32-bit Linux). Update these to "arm$" to prevent this, and also update three tests (TestBuiltinFormats.py, TestCrossDSOTailCalls.py, TestCrossObjectTailCalls.py) that were skipped for arm64 via this behavior, and need to be skipped or they will fail. This was moviated by the new TestDynamicValue.py test which has an expected-fail for arm, but the test was passing on arm64 Darwin resulting in failure for the CIs.
52 lines
1.9 KiB
Python
52 lines
1.9 KiB
Python
"""Test that lldb picks the correct DWARF location list entry with a return-pc out of bounds."""
|
|
|
|
import lldb
|
|
from lldbsuite.test.decorators import *
|
|
from lldbsuite.test.lldbtest import *
|
|
from lldbsuite.test import lldbutil
|
|
|
|
|
|
class LocationListLookupTestCase(TestBase):
|
|
def launch(self) -> lldb.SBProcess:
|
|
exe = self.getBuildArtifact("a.out")
|
|
target = self.dbg.CreateTarget(exe)
|
|
self.assertTrue(target, VALID_TARGET)
|
|
self.dbg.SetAsync(False)
|
|
|
|
li = lldb.SBLaunchInfo(["a.out"])
|
|
error = lldb.SBError()
|
|
process = target.Launch(li, error)
|
|
self.assertTrue(process.IsValid())
|
|
self.assertTrue(process.is_stopped)
|
|
|
|
return process
|
|
|
|
def check_local_vars(self, process: lldb.SBProcess, check_expr: bool):
|
|
# Find `bar` on the stack, then
|
|
# make sure we can read out the local
|
|
# variables (with both `frame var` and `expr`)
|
|
for f in process.selected_thread.frames:
|
|
frame_name = f.GetDisplayFunctionName()
|
|
if frame_name is not None and frame_name.startswith("Foo::bar"):
|
|
argv = f.GetValueForVariablePath("argv").GetChildAtIndex(0)
|
|
strm = lldb.SBStream()
|
|
argv.GetDescription(strm)
|
|
self.assertNotEqual(strm.GetData().find("a.out"), -1)
|
|
|
|
if check_expr:
|
|
process.selected_thread.selected_frame = f
|
|
self.expect_expr("this", result_type="Foo *")
|
|
|
|
@skipIf(oslist=["linux"], archs=["arm$"])
|
|
@skipIfDarwin
|
|
def test_loclist_frame_var(self):
|
|
self.build()
|
|
self.check_local_vars(self.launch(), check_expr=False)
|
|
|
|
@skipIf(dwarf_version=["<", "3"])
|
|
@skipIf(compiler="clang", compiler_version=["<", "12.0"])
|
|
@skipUnlessDarwin
|
|
def test_loclist_expr(self):
|
|
self.build()
|
|
self.check_local_vars(self.launch(), check_expr=True)
|