[Lldb-commits] [lldb] r230468 - Add extra acceptable characters to CMICmdArgValFile (MI)

Ilia K ki.stfu at gmail.com
Tue Feb 24 22:34:06 PST 2015


Author: ki.stfu
Date: Wed Feb 25 00:34:05 2015
New Revision: 230468

URL: http://llvm.org/viewvc/llvm-project?rev=230468&view=rev
Log:
Add extra acceptable characters to CMICmdArgValFile (MI)

Summary:
Improve CMICmdArgValFile::IsValidChars to accept extra characters that can be in file name:
```
.'\"`@#$%^&*()_+-={}[]| 
```

Enable MiSyntaxTestCase.test_lldbmi_specialchars test.

All test pass on OS X.

Reviewers: abidh, emaste, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, zturner, emaste, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7859

Modified:
    lldb/trunk/test/tools/lldb-mi/TestMiSyntax.py
    lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp

Modified: lldb/trunk/test/tools/lldb-mi/TestMiSyntax.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/tools/lldb-mi/TestMiSyntax.py?rev=230468&r1=230467&r2=230468&view=diff
==============================================================================
--- lldb/trunk/test/tools/lldb-mi/TestMiSyntax.py (original)
+++ lldb/trunk/test/tools/lldb-mi/TestMiSyntax.py Wed Feb 25 00:34:05 2015
@@ -36,7 +36,6 @@ class MiSyntaxTestCase(lldbmi_testcase.M
 
     @lldbmi_test
     @expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
-    @unittest2.skip("lldb-mi doesn't handle special chars properly")
     def test_lldbmi_specialchars(self):
         """Test that 'lldb-mi --interpreter' handles complicated strings."""
 

Modified: lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp?rev=230468&r1=230467&r2=230468&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp Wed Feb 25 00:34:05 2015
@@ -193,13 +193,14 @@ CMICmdArgValFile::IsFilePath(const CMIUt
 bool
 CMICmdArgValFile::IsValidChars(const CMIUtilString &vrText) const
 {
+    static CMIUtilString s_strSpecialCharacters(".'\"`@#$%^&*()_+-={}[]| ");
     const MIchar *pPtr = const_cast<MIchar *>(vrText.c_str());
     for (MIuint i = 0; i < vrText.length(); i++, pPtr++)
     {
         const MIchar c = *pPtr;
         if (::isalnum((int)c) == 0)
         {
-            if ((c != '.') && (c != '-') && (c != '_'))
+            if (s_strSpecialCharacters.find(c) == CMIUtilString::npos)
                 return false;
         }
     }





More information about the lldb-commits mailing list