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