aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/functionalities/alias/TestBtAliasRepeat.py
blob: 60c0dd0a233bfa71ae128c1d74d591671db03e1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import lldb
from lldbsuite.test.lldbtest import TestBase
from lldbsuite.test import lldbutil


class TestCase(TestBase):
    def test(self):
        self.build()
        lldbutil.run_to_source_breakpoint(self, "return", lldb.SBFileSpec("main.c"))

        # Expect "frame #0" but not "frame #1".
        self.expect("bt 1", inHistory=True, patterns=["frame #0", "(?!.*frame #1)"])

        # Run an empty command to run the repeat command for `bt`.
        # The repeat command for `bt N` lists the subsequent N frames.
        #
        # In this case, after printing the frame 0 with `bt 1`, the repeat
        # command will print "frame #1" (and won't print "frame #0").
        self.expect("", patterns=["^(?!.*frame #0)", "frame #1"])