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

Ilia K ki.stfu at gmail.com
Tue Feb 24 07:49:38 PST 2015


Hi abidh, clayborg, emaste, zturner,

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.

http://reviews.llvm.org/D7859

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

Index: tools/lldb-mi/MICmdArgValFile.cpp
===================================================================
--- tools/lldb-mi/MICmdArgValFile.cpp
+++ tools/lldb-mi/MICmdArgValFile.cpp
@@ -193,13 +193,14 @@
 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;
         }
     }
Index: test/tools/lldb-mi/TestMiSyntax.py
===================================================================
--- test/tools/lldb-mi/TestMiSyntax.py
+++ test/tools/lldb-mi/TestMiSyntax.py
@@ -36,7 +36,6 @@
 
     @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."""

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7859.20598.patch
Type: text/x-patch
Size: 1255 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150224/3cd88752/attachment.bin>


More information about the lldb-commits mailing list