[all-commits] [llvm/llvm-project] b58af8: [lldb] Improve error message when --func-regex par...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Mon Apr 27 00:55:47 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b58af8d254ee1b1a7d2806b1fdfe295df925748a
      https://github.com/llvm/llvm-project/commit/b58af8d254ee1b1a7d2806b1fdfe295df925748a
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-04-27 (Mon, 27 Apr 2020)

  Changed paths:
    M lldb/source/Commands/CommandObjectBreakpoint.cpp
    M lldb/source/Utility/RegularExpression.cpp
    A lldb/test/API/commands/breakpoint/set/func-regex/TestBreakpointRegexError.py

  Log Message:
  -----------
  [lldb] Improve error message when --func-regex parameter for the breakpoint command is invalid

Summary:
Currently the breakpoint command is prompting the user to file a bug report if the provided regex is invalid:
```
(lldb) rbreak *foo
error: Function name regular expression could not be compiled: "Inconvertible error value. An error has occurred that could not be converted to a known std::error_code. Please file a bug. repetition-operator operand invalid"
```

The reason is simply that we are using the wrong StringError constructor (the one with the error code as the first parameter
is also printing the string version of the error code, and the inconvertible error code is just an invalid place holder code with
that description). Switching the StringError constructor parameters will only print the error message we get from the regex
engine when we convert the error into a string.

I checked the rest of the code base and I couldn't find the same issue anywhere else.

Fixes rdar://62233561

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D78808




More information about the All-commits mailing list