1
"""Test that lldb picks the correct DWARF location list entry with a return-pc out of bounds."""
4 from lldbsuite
.test
.decorators
import *
5 from lldbsuite
.test
.lldbtest
import *
6 from lldbsuite
.test
import lldbutil
9 class LocationListLookupTestCase(TestBase
):
11 # Call super's setUp().
14 @skipIf(oslist
=["linux"], archs
=["arm"])
15 def test_loclist(self
):
17 exe
= self
.getBuildArtifact("a.out")
19 # Create a target by the debugger.
20 target
= self
.dbg
.CreateTarget(exe
)
21 self
.assertTrue(target
, VALID_TARGET
)
22 self
.dbg
.SetAsync(False)
24 li
= lldb
.SBLaunchInfo(["a.out"])
25 error
= lldb
.SBError()
26 process
= target
.Launch(li
, error
)
27 self
.assertTrue(process
.IsValid())
28 self
.assertTrue(process
.is_stopped
)
30 # Find `main` on the stack, then
31 # find `argv` local variable, then
32 # check that we can read the c-string in argv[0]
33 for f
in process
.GetSelectedThread().frames
:
34 if f
.GetDisplayFunctionName() == "main":
35 argv
= f
.GetValueForVariablePath("argv").GetChildAtIndex(0)
36 strm
= lldb
.SBStream()
37 argv
.GetDescription(strm
)
38 self
.assertNotEqual(strm
.GetData().find("a.out"), -1)