Skip to content

[lldb] Warn the user about starting the --func-regex parameter with a… #1190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: apple/stable/20200108
Choose a base branch
from

Conversation

Teemperor
Copy link

@Teemperor Teemperor commented May 7, 2020

…n asterisk

Summary:
Sometimes users think that setting a function regex for all function that contain the word 'needle' in their
name looks like this: *needle*. However, LLDB only searches the function name and doesn't fully match
it against the regex, so the leading and trailing '*' operators don't do anything and actually just cause the
regex engine to reject the regular expression with "repetition-operator operand invalid".

This patch makes this a bit more obvious to the user by printing a warning that a leading '' before this
regular expression here doesn't have any purpose (and will cause an error). This doesn't attempt to detect
a case where there is only a trailing '
' as that would involve parsing the regex and it seems the most
common way to end up in this situation is by doing rbreak *needle*.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

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

Small follow-up for rdar://problem/62233561
(cherry picked from commit aaf68cd)

…n asterisk

Summary:
Sometimes users think that setting a function regex for all function that contain the word 'needle' in their
name looks like this: `*needle*`. However, LLDB only searches the function name and doesn't fully match
it against the regex, so the leading and trailing '*' operators don't do anything and actually just cause the
regex engine to reject the regular expression with "repetition-operator operand invalid".

This patch makes this a bit more obvious to the user by printing a warning that a leading '*' before this
regular expression here doesn't have any purpose (and will cause an error). This doesn't attempt to detect
a case where there is only a trailing '*' as that would involve parsing the regex and it seems the most
common way to end up in this situation is by doing `rbreak *needle*`.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

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

(cherry picked from commit aaf68cd)
@Teemperor Teemperor requested a review from fredriss May 7, 2020 11:30
@Teemperor
Copy link
Author

@swift-ci test

Copy link
Member

@dcci dcci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raph, shall we merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants