28 lines · python
1"""2Make sure that "target modules lookup -va $pc" works3"""4 5 6import lldb7import lldbsuite.test.lldbutil as lldbutil8from lldbsuite.test.lldbtest import *9 10 11class TestImageLookupPCInC(TestBase):12 def test_sample_rename_this(self):13 """There can be many tests in a test case - describe this test here."""14 self.build()15 self.main_source_file = lldb.SBFileSpec("main.c")16 self.sample_test()17 18 def sample_test(self):19 """Make sure the address expression resolves to the right function"""20 21 (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(22 self, "Set a breakpoint here", self.main_source_file23 )24 25 self.expect("target modules lookup -va $pc", substrs=["doSomething"])26 self.expect("target modules lookup -va $pc+4", substrs=["doSomething"])27 28