llvm-project/lldb
Ilia K 69b95f49f1 Fix handling of double quotes (MI)
Summary:
* Clean CMICmdArgValString::Validate: now it's based on CMIUtilString::SplitConsiderQuotes method:
A bit of introduction:
# Command line is wrapped into CMICmdArgContext.
# CMICmdArgSet is a set of arguments to be parsed. This class contains CMICmdArgContext as a private member.
# MI command is class which is inhereted from CMICmdBase. It contains CMICmdArgSet as a private member.

When command is executed CMICmdBase::ParseArgs() is called. This method adds args for parsing using CMICmdArgSet::Add(). Then CMICmdBase::ParseValidateCmdOptions() is called, which calls CMICmdArgSet::Validate(). Then it gets a number of arguments (using SplitConsiderQuotes().array_length) and for each arguments registered in ParseArgs() tries to validate it using CMICmdArgValBase::Validate(). Every user commands parses this string again (first time it was made in SplitConsiderQuotes) and in case of CMICmdArgValString it was made incorrectly. It searches the first and last quotes (but it should be first and next after first). Besides, it was splitted into 4 cases. 
I'm just using SplitConsiderQuotes directly, and I don't split them by hand again. 

Actually, I think we should do so in every CMICmdArgVal_XXX::Validate() method.

* Enable MiInterpreterExecTestCase.test_lldbmi_target_create test
* Fix MiExecTestCase.test_lldbmi_exec_arguments_set test

All tests 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/D7860

llvm-svn: 230654
2015-02-26 18:21:22 +00:00
..
cmake Resubmit "[CMake] Change lldbAPI to be a CMake OBJECT library." 2015-02-24 22:17:57 +00:00
docs Add qModuleInfo request in order to get module information (uuid, triple,..) by module path from remote platform. 2015-02-25 22:15:44 +00:00
examples Specify ObjC++ when running heap commands in case we are stopped in a frame with another language. 2015-01-14 21:37:19 +00:00
gtest Fix compilation error and cleanup in ThreadStateCoordinatorTest 2015-02-03 01:51:54 +00:00
include Return a current executable's directory from HostInfoAndroid::ComputeSupportExeDirectory. 2015-02-26 02:50:14 +00:00
lib Fix configure+make build broken by r228943 (part 2) 2015-02-13 12:27:24 +00:00
lldb.xcodeproj Fixed Xcode project after recent changes: 2015-02-24 23:50:21 +00:00
lldb.xcworkspace Fixup gtest layout, add Linux ThreadStateCoordinator.cpp. 2014-09-25 19:25:07 +00:00
resources Bump the verison number in the xcode project files. 2014-08-21 23:27:02 +00:00
scripts [swig] Generate bindings for SBDebugger::*UseColor(). 2015-02-26 17:46:16 +00:00
source Test commit - fix typo. 2015-02-26 13:03:57 +00:00
test Fix handling of double quotes (MI) 2015-02-26 18:21:22 +00:00
tools Fix handling of double quotes (MI) 2015-02-26 18:21:22 +00:00
utils LUI: Fix some issues causing crashes in the source view 2013-10-23 01:18:21 +00:00
www Fix broken link to 'Obtaining Commit Access' 2015-02-18 16:51:30 +00:00
.arcconfig Update .arcconfig to point to reviews.llvm.org 2014-05-20 21:24:59 +00:00
.clang-format Fix .clang-format file to adhere to LLDB 140 column limit. 2014-08-19 17:18:38 +00:00
.gitignore Added remote-build.py and wired it into Xcode for Linux and MacOSX+Linux builds. 2015-02-03 01:50:39 +00:00
CMakeLists.txt [CMake] Clean up lldb-mi CMakeLists.txt. 2015-02-24 23:36:12 +00:00
INSTALL.txt Revert "git-svn test commit" 2014-11-18 22:45:59 +00:00
LICENSE.TXT
Makefile Remove the -Wno-unused-function option. We are clean 2014-09-09 07:49:15 +00:00