aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp2
-rw-r--r--lldb/source/Utility/RegularExpression.cpp4
-rw-r--r--lldb/test/API/commands/breakpoint/set/func-regex/TestBreakpointRegexError.py14
3 files changed, 17 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 3c5d8f0..661ebc7 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -620,7 +620,7 @@ protected:
RegularExpression regexp(m_options.m_func_regexp);
if (llvm::Error err = regexp.GetError()) {
result.AppendErrorWithFormat(
- "Function name regular expression could not be compiled: \"%s\"",
+ "Function name regular expression could not be compiled: %s",
llvm::toString(std::move(err)).c_str());
result.SetStatus(eReturnStatusFailed);
return false;
diff --git a/lldb/source/Utility/RegularExpression.cpp b/lldb/source/Utility/RegularExpression.cpp
index 3736a25..20bebbf 100644
--- a/lldb/source/Utility/RegularExpression.cpp
+++ b/lldb/source/Utility/RegularExpression.cpp
@@ -35,7 +35,7 @@ llvm::StringRef RegularExpression::GetText() const { return m_regex_text; }
llvm::Error RegularExpression::GetError() const {
std::string error;
if (!m_regex.isValid(error))
- return llvm::make_error<llvm::StringError>(llvm::inconvertibleErrorCode(),
- error);
+ return llvm::make_error<llvm::StringError>(error,
+ llvm::inconvertibleErrorCode());
return llvm::Error::success();
}
diff --git a/lldb/test/API/commands/breakpoint/set/func-regex/TestBreakpointRegexError.py b/lldb/test/API/commands/breakpoint/set/func-regex/TestBreakpointRegexError.py
new file mode 100644
index 0000000..a8cfcf2
--- /dev/null
+++ b/lldb/test/API/commands/breakpoint/set/func-regex/TestBreakpointRegexError.py
@@ -0,0 +1,14 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @no_debug_info_test
+ def test_error(self):
+ self.expect("breakpoint set --func-regex (", error=True,
+ substrs=["error: Function name regular expression could " +
+ "not be compiled: parentheses not balanced"])