1import lldb 2from lldbsuite.test.decorators import * 3from lldbsuite.test.lldbtest import * 4from lldbsuite.test import lldbutil 5 6class TestCase(TestBase): 7 8 mydir = TestBase.compute_mydir(__file__) 9 10 @no_debug_info_test 11 def test_error(self): 12 self.expect("breakpoint set --func-regex (", error=True, 13 substrs=["error: Function name regular expression could " + 14 "not be compiled: parentheses not balanced"]) 15 16 # Point out if looks like the user provided a globbing expression. 17 self.expect("breakpoint set --func-regex *a", error=True, 18 substrs=["error: Function name regular expression could " + 19 "not be compiled: repetition-operator operand invalid", 20 "warning: Function name regex does not accept glob patterns."]) 21 self.expect("breakpoint set --func-regex ?a", error=True, 22 substrs=["error: Function name regular expression could " + 23 "not be compiled: repetition-operator operand invalid", 24 "warning: Function name regex does not accept glob patterns."]) 25 # Make sure that warning is only shown for invalid regular expressions 26 # that look like a globbing expression (i.e., they have a leading * or ?). 27 self.expect("breakpoint set --func-regex a*+", error=True, matching=False, 28 substrs=["warning: Function name regex does not accept glob patterns."]) 29 self.expect("breakpoint set --func-regex a?+", error=True, matching=False, 30 substrs=["warning: Function name regex does not accept glob patterns."]) 31