2 Test _regexp-break command which uses regular expression matching to dispatch to other built in breakpoint commands.
5 from __future__ import print_function
11 from lldbsuite.test.lldbtest import *
12 import lldbsuite.test.lldbutil as lldbutil
15 class RegexpBreakCommandTestCase(TestBase):
17 mydir = TestBase.compute_mydir(__file__)
20 """Test _regexp-break command."""
22 self.regexp_break_command()
25 # Call super's setUp().
27 # Find the line number to break inside main().
28 self.source = 'main.c'
29 self.line = line_number(
30 self.source, '// Set break point at this line.')
32 def regexp_break_command(self):
33 """Test the super consie "b" command, which is analias for _regexp-break."""
34 exe = os.path.join(os.getcwd(), "a.out")
35 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
37 break_results = lldbutil.run_break_set_command(
40 lldbutil.check_breakpoint_result(
44 line_number=self.line,
47 break_results = lldbutil.run_break_set_command(
48 self, "b %s:%d" % (self.source, self.line))
49 lldbutil.check_breakpoint_result(
53 line_number=self.line,
56 # Check breakpoint with full file path.
57 full_path = os.path.join(os.getcwd(), self.source)
58 break_results = lldbutil.run_break_set_command(
59 self, "b %s:%d" % (full_path, self.line))
60 lldbutil.check_breakpoint_result(
64 line_number=self.line,
67 self.runCmd("run", RUN_SUCCEEDED)
69 # The stop reason of the thread should be breakpoint.
70 self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
72 'stop reason = breakpoint'])