20 lines · python
1import lldb2from lldbsuite.test.lldbtest import TestBase3from lldbsuite.test import lldbutil4 5 6class TestCase(TestBase):7 def test(self):8 self.build()9 lldbutil.run_to_source_breakpoint(self, "return", lldb.SBFileSpec("main.c"))10 11 # Expect "frame #0" but not "frame #1".12 self.expect("bt 1", inHistory=True, patterns=["frame #0", "(?!.*frame #1)"])13 14 # Run an empty command to run the repeat command for `bt`.15 # The repeat command for `bt N` lists the subsequent N frames.16 #17 # In this case, after printing the frame 0 with `bt 1`, the repeat18 # command will print "frame #1" (and won't print "frame #0").19 self.expect("", patterns=["^(?!.*frame #0)", "frame #1"])20