2 Test _regexp-break command which uses regular expression matching to dispatch to other built in breakpoint commands.
5 from __future__ import print_function
10 from lldbsuite.test.lldbtest import *
11 import lldbsuite.test.lldbutil as lldbutil
14 class RegexpBreakCommandTestCase(TestBase):
16 mydir = TestBase.compute_mydir(__file__)
19 """Test _regexp-break command."""
21 self.regexp_break_command()
24 # Call super's setUp().
26 # Find the line number to break inside main().
27 self.source = 'main.c'
28 self.line = line_number(
29 self.source, '// Set break point at this line.')
31 def regexp_break_command(self):
32 """Test the super consie "b" command, which is analias for _regexp-break."""
33 exe = self.getBuildArtifact("a.out")
34 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
36 break_results = lldbutil.run_break_set_command(
39 lldbutil.check_breakpoint_result(
43 line_number=self.line,
46 break_results = lldbutil.run_break_set_command(
47 self, "b %s:%d" % (self.source, self.line))
48 lldbutil.check_breakpoint_result(
52 line_number=self.line,
55 # Check breakpoint with full file path.
56 full_path = os.path.join(self.getSourceDir(), self.source)
57 break_results = lldbutil.run_break_set_command(
58 self, "b %s:%d" % (full_path, self.line))
59 lldbutil.check_breakpoint_result(
63 line_number=self.line,
66 self.runCmd("run", RUN_SUCCEEDED)
68 # The stop reason of the thread should be breakpoint.
69 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
71 'stop reason = breakpoint'])