summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia K <ki.stfu@gmail.com>2015-02-25 06:34:05 +0000
committerIlia K <ki.stfu@gmail.com>2015-02-25 06:34:05 +0000
commit4dc4ed0a2ab105c2a3f06b17c375b7ef9d90d0ec (patch)
tree0fc0e719a575b9a2c64d3479208cfd0b0dba05c5
parenta5de1433b7418cc54204f3170542234768f7d4af (diff)
downloadbcm5719-llvm-4dc4ed0a2ab105c2a3f06b17c375b7ef9d90d0ec.tar.gz
bcm5719-llvm-4dc4ed0a2ab105c2a3f06b17c375b7ef9d90d0ec.zip
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 llvm-svn: 230468
-rw-r--r--lldb/test/tools/lldb-mi/TestMiSyntax.py1
-rw-r--r--lldb/tools/lldb-mi/MICmdArgValFile.cpp3
2 files changed, 2 insertions, 2 deletions
diff --git a/lldb/test/tools/lldb-mi/TestMiSyntax.py b/lldb/test/tools/lldb-mi/TestMiSyntax.py
index 51a02aea0f6..9f3e32c84c0 100644
--- a/lldb/test/tools/lldb-mi/TestMiSyntax.py
+++ b/lldb/test/tools/lldb-mi/TestMiSyntax.py
@@ -36,7 +36,6 @@ class MiSyntaxTestCase(lldbmi_testcase.MiTestCaseBase):
@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."""
diff --git a/lldb/tools/lldb-mi/MICmdArgValFile.cpp b/lldb/tools/lldb-mi/MICmdArgValFile.cpp
index cee811f24de..591ee9b358c 100644
--- a/lldb/tools/lldb-mi/MICmdArgValFile.cpp
+++ b/lldb/tools/lldb-mi/MICmdArgValFile.cpp
@@ -193,13 +193,14 @@ CMICmdArgValFile::IsFilePath(const CMIUtilString &vrFileNamePath) const
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;
}
}
OpenPOWER on IntegriCloud