llvm-capstone/lldb/source/Commands
Pavel Labath c4a3395103 Fix a couple of corner cases in NameMatches
Summary:
I originally set out to move the NameMatches closer to the relevant
function and add some unit tests. However, in the process I've found a
couple of bugs in the implementation:
- the early exits where not always correct:
  - (test==pattern) does not mean the match will always suceed because
    of regular expressions
  - pattern.empty() does not mean the match will fail because the "" is
    a valid prefix of any string

So I cleaned up those and added some tests. The only tricky part here
was that regcomp() implementation on darwin did not recognise the empty
string as a regular expression and returned an REG_EMPTY error instead.
The simples fix here seemed to be to replace the empty expression with
an equivalent non-empty one.

Reviewers: clayborg, zturner

Subscribers: mgorny, lldb-commits

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

llvm-svn: 295651
2017-02-20 11:35:33 +00:00
..
CMakeLists.txt [cmake] add missing dependency lldbCommands->lldbBase 2017-02-09 01:17:34 +00:00
CommandCompletions.cpp Convert AutoComplete related code to StringRef. 2016-11-17 01:37:42 +00:00
CommandObjectApropos.cpp Add methods to enable using formatv syntax in LLDB. 2016-12-16 04:27:00 +00:00
CommandObjectApropos.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectArgs.cpp Make Options::SetOptionValue take a StringRef. 2016-11-12 16:56:47 +00:00
CommandObjectArgs.h Make Options::SetOptionValue take a StringRef. 2016-11-12 16:56:47 +00:00
CommandObjectBreakpoint.cpp Move classes from Core -> Utility. 2017-02-02 21:39:50 +00:00
CommandObjectBreakpoint.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectBreakpointCommand.cpp Make Options::SetOptionValue take a StringRef. 2016-11-12 16:56:47 +00:00
CommandObjectBreakpointCommand.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectBugreport.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectBugreport.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectCommands.cpp Fix some occurrences of passing StringRef to Printf. 2016-12-09 01:20:58 +00:00
CommandObjectCommands.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectDisassemble.cpp Make Options::SetOptionValue take a StringRef. 2016-11-12 16:56:47 +00:00
CommandObjectDisassemble.h Make Options::SetOptionValue take a StringRef. 2016-11-12 16:56:47 +00:00
CommandObjectExpression.cpp Use Timeout<> in EvaluateExpressionOptions class 2016-12-06 11:24:51 +00:00
CommandObjectExpression.h Make Options::SetOptionValue take a StringRef. 2016-11-12 16:56:47 +00:00
CommandObjectFrame.cpp Move classes from Core -> Utility. 2017-02-02 21:39:50 +00:00
CommandObjectFrame.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectGUI.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectGUI.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectHelp.cpp Modernize the Args access pattern in a few more commands. 2016-12-09 01:08:29 +00:00
CommandObjectHelp.h Update GenerateAdditionalHelpAvenues to take StringRef. 2016-11-16 21:34:22 +00:00
CommandObjectLanguage.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectLanguage.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectLog.cpp Reapply "Refactor log channel registration mechanism" 2017-02-17 13:27:42 +00:00
CommandObjectLog.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectMemory.cpp Move classes from Core -> Utility. 2017-02-02 21:39:50 +00:00
CommandObjectMemory.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectMultiword.cpp Remove some more uses of Args::GetArgumentAtIndex. 2016-12-09 05:46:41 +00:00
CommandObjectPlatform.cpp Fix a couple of corner cases in NameMatches 2017-02-20 11:35:33 +00:00
CommandObjectPlatform.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectPlugin.cpp Remove some more uses of Args::GetArgumentAtIndex. 2016-12-09 05:46:41 +00:00
CommandObjectPlugin.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectProcess.cpp Fix a couple of corner cases in NameMatches 2017-02-20 11:35:33 +00:00
CommandObjectProcess.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectQuit.cpp Don't allow direct access to StreamString's internal buffer. 2016-11-16 21:15:24 +00:00
CommandObjectQuit.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectRegister.cpp Remove some more uses of Args::GetArgumentAtIndex. 2016-12-09 05:46:41 +00:00
CommandObjectRegister.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectSettings.cpp Re-add "demonstrate new Args API" 2016-11-22 17:10:15 +00:00
CommandObjectSettings.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectSource.cpp Remove some more uses of Args::GetArgumentAtIndex. 2016-12-09 05:46:41 +00:00
CommandObjectSource.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectSyntax.cpp Remove some more uses of Args::GetArgumentAtIndex. 2016-12-09 05:46:41 +00:00
CommandObjectSyntax.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectTarget.cpp Provide option to set pc of the file loaded in memory. 2017-01-24 23:07:27 +00:00
CommandObjectTarget.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectThread.cpp Remove \x13 (^S) character that was likely added by mistake. 2016-11-24 10:01:34 +00:00
CommandObjectThread.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectType.cpp Move classes from Core -> Utility. 2017-02-02 21:39:50 +00:00
CommandObjectType.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectVersion.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectVersion.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectWatchpoint.cpp Move classes from Core -> Utility. 2017-02-02 21:39:50 +00:00
CommandObjectWatchpoint.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
CommandObjectWatchpointCommand.cpp Make Options::SetOptionValue take a StringRef. 2016-11-12 16:56:47 +00:00
CommandObjectWatchpointCommand.h *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00