2 Test _regexp-break command which uses regular expression matching to dispatch to other built in breakpoint commands.
9 from lldbsuite.test.lldbtest import *
10 import lldbsuite.test.lldbutil as lldbutil
13 class RegexpBreakCommandTestCase(TestBase):
15 mydir = TestBase.compute_mydir(__file__)
18 """Test _regexp-break command."""
20 self.regexp_break_command()
23 # Call super's setUp().
25 # Find the line number to break inside main().
26 self.source = 'main.c'
27 self.line = line_number(
28 self.source, '// Set break point at this line.')
30 def regexp_break_command(self):
31 """Test the super consie "b" command, which is analias for _regexp-break."""
32 exe = self.getBuildArtifact("a.out")
33 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
35 break_results = lldbutil.run_break_set_command(
38 lldbutil.check_breakpoint_result(
42 line_number=self.line,
45 break_results = lldbutil.run_break_set_command(
46 self, "b %s:%d" % (self.source, self.line))
47 lldbutil.check_breakpoint_result(
51 line_number=self.line,
54 # Check breakpoint with full file path.
55 full_path = os.path.join(self.getSourceDir(), self.source)
56 break_results = lldbutil.run_break_set_command(
57 self, "b %s:%d" % (full_path, self.line))
58 lldbutil.check_breakpoint_result(
62 line_number=self.line,
65 self.runCmd("run", RUN_SUCCEEDED)
67 # The stop reason of the thread should be breakpoint.
68 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
70 'stop reason = breakpoint'])