diff options
author | Ilia K <ki.stfu@gmail.com> | 2016-09-22 05:08:41 +0000 |
---|---|---|
committer | Ilia K <ki.stfu@gmail.com> | 2016-09-22 05:08:41 +0000 |
commit | a3174853b7b861d02eadd3d14330ad428fb73124 (patch) | |
tree | 5ec21b0adfa48f722324a0979a8825984374b0e6 /lldb/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py | |
parent | c669522a261dbed599f9d60e7ce11d9c1491903a (diff) | |
download | bcm5719-llvm-a3174853b7b861d02eadd3d14330ad428fb73124.tar.gz bcm5719-llvm-a3174853b7b861d02eadd3d14330ad428fb73124.zip |
Fix parsing expressions to evaluate with spaces and optional args (MI)
Summary:
When extracting options for long options (starting with `--`), the use of
`MIUtilString::SplitConsiderQuotes` to split all the arguments was being
conditioned on the option type to be expected. This was wrong as this caused
other options to be parsed incorrectly since it was not taking into account the
presence of quotes.
Patch by Ed Munoz <edmunoz@microsoft.com>
Reviewers: edmunoz, ki.stfu
Subscribers: ki.stfu, lldb-commits
Projects: #lldb
Differential Revision: https://reviews.llvm.org/D24202
llvm-svn: 282135
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py index c274efe793c..b76b59ab97e 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py @@ -61,7 +61,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase): self.expect("\^done,value=\"30\"") self.runCmd("-var-update --all-values var2") # self.expect("\^done,changelist=\[\{name=\"var2\",value=\"30\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\]") - # #FIXME -var-update doesn't work + # FIXME -var-update doesn't work self.runCmd("-var-delete var2") self.expect("\^done") self.runCmd("-var-create var2 * g_MyVar") @@ -84,7 +84,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase): self.expect("\^done,value=\"3\"") self.runCmd("-var-update --all-values var3") # self.expect("\^done,changelist=\[\{name=\"var3\",value=\"3\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\]") - # #FIXME -var-update doesn't work + # FIXME -var-update doesn't work self.runCmd("-var-delete var3") self.expect("\^done") self.runCmd("-var-create var3 * s_MyVar") @@ -107,7 +107,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase): self.expect("\^done,value=\"2\"") self.runCmd("-var-update --all-values var4") # self.expect("\^done,changelist=\[\{name=\"var4\",value=\"2\",in_scope=\"true\",type_changed=\"false\",has_more=\"0\"\}\]") - # #FIXME -var-update doesn't work + # FIXME -var-update doesn't work self.runCmd("-var-delete var4") self.expect("\^done") self.runCmd("-var-create var4 * b") @@ -148,6 +148,13 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase): self.expect( "\^done,numchild=\"1\",children=\[child=\{name=\"var6\.\*\$[0-9]+\",exp=\"\*\$[0-9]+\",numchild=\"0\",type=\"const char\",thread-id=\"4294967295\",value=\"47 '/'\",has_more=\"0\"\}\],has_more=\"0\"") + # Print an expression with spaces and optional arguments + self.runCmd("-data-evaluate-expression \"a + b\"") + self.expect("\^done,value=\"12\"") + self.runCmd("-var-create var7 * \"a + b\" --thread 1 --frame 0") + self.expect( + "\^done,name=\"var7\",numchild=\"0\",value=\"12\",type=\"int\",thread-id=\"1\",has_more=\"0\"") + @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots @@ -315,12 +322,14 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase): # Test that -var-list-children lists all children with their values # (and that from and to are optional) self.runCmd("-var-list-children --all-values var_complx") - self.expect("\^done,numchild=\"3\",children=\[child=\{name=\"var_complx\.i\",exp=\"i\",numchild=\"0\",type=\"int\",thread-id=\"1\",value=\"3\",has_more=\"0\"\},child=\{name=\"var_complx\.inner\",exp=\"inner\",numchild=\"1\",type=\"complex_type::\(anonymous struct\)\",thread-id=\"1\",value=\"\{\.\.\.\}\",has_more=\"0\"\},child=\{name=\"var_complx\.complex_ptr\",exp=\"complex_ptr\",numchild=\"3\",type=\"complex_type \*\",thread-id=\"1\",value=\"0x[0-9a-f]+\",has_more=\"0\"\}\],has_more=\"0\"") + self.expect( + "\^done,numchild=\"3\",children=\[child=\{name=\"var_complx\.i\",exp=\"i\",numchild=\"0\",type=\"int\",thread-id=\"1\",value=\"3\",has_more=\"0\"\},child=\{name=\"var_complx\.inner\",exp=\"inner\",numchild=\"1\",type=\"complex_type::\(anonymous struct\)\",thread-id=\"1\",value=\"\{\.\.\.\}\",has_more=\"0\"\},child=\{name=\"var_complx\.complex_ptr\",exp=\"complex_ptr\",numchild=\"3\",type=\"complex_type \*\",thread-id=\"1\",value=\"0x[0-9a-f]+\",has_more=\"0\"\}\],has_more=\"0\"") self.runCmd("-var-list-children --simple-values var_complx_array") self.expect( "\^done,numchild=\"2\",children=\[child=\{name=\"var_complx_array\.\[0\]\",exp=\"\[0\]\",numchild=\"3\",type=\"complex_type\",thread-id=\"1\",has_more=\"0\"\},child=\{name=\"var_complx_array\.\[1\]\",exp=\"\[1\]\",numchild=\"3\",type=\"complex_type\",thread-id=\"1\",has_more=\"0\"\}\],has_more=\"0\"") self.runCmd("-var-list-children 0 var_pcomplx") - self.expect("\^done,numchild=\"2\",children=\[child=\{name=\"var_pcomplx\.complex_type\",exp=\"complex_type\",numchild=\"3\",type=\"complex_type\",thread-id=\"1\",has_more=\"0\"\},child={name=\"var_pcomplx\.complx\",exp=\"complx\",numchild=\"3\",type=\"complex_type\",thread-id=\"1\",has_more=\"0\"\}\],has_more=\"0\"") + self.expect( + "\^done,numchild=\"2\",children=\[child=\{name=\"var_pcomplx\.complex_type\",exp=\"complex_type\",numchild=\"3\",type=\"complex_type\",thread-id=\"1\",has_more=\"0\"\},child={name=\"var_pcomplx\.complx\",exp=\"complx\",numchild=\"3\",type=\"complex_type\",thread-id=\"1\",has_more=\"0\"\}\],has_more=\"0\"") # Test that -var-list-children lists children without values self.runCmd("-var-list-children 0 var_complx 0 1") |