This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by teemperor on Apr 24 2020, 7:30 AM.

Details

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

Diff Detail

Event Timeline

teemperor created this revision.Apr 24 2020, 7:30 AM
teemperor edited the summary of this revision. (Show Details)
teemperor added a subscriber: lldb-commits.
JDevlieghere accepted this revision.Apr 24 2020, 10:16 AM
This revision is now accepted and ready to land.Apr 24 2020, 10:16 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2020, 1:01 AM