Files
clang-p2996/lldb/test/API/functionalities/alias/TestBtAliasRepeat.py
Dave Lee 5e0ee1b395 [lldb] Make repeat commands work for regex commands
Fix logic for repeat commands, so that regex commands (specificially `bt`) are
given the opportunity to provide a repeat command.

rdar://104562616

Differential Revision: https://reviews.llvm.org/D143695
2023-03-08 16:21:42 -08:00

20 lines
742 B
Python

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"])