summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2015-04-28 10:03:55 +0000
committerBruce Mitchener <bruce.mitchener@gmail.com>2015-04-28 10:03:55 +0000
commit41ad9c412827ed897bf37ae62a2035317652fa57 (patch)
tree4944d1506efaa0c1040235d759740d6909c63951
parentae518539246c4d985dce34ff8fae86b8c6be032d (diff)
downloadbcm5719-llvm-41ad9c412827ed897bf37ae62a2035317652fa57.tar.gz
bcm5719-llvm-41ad9c412827ed897bf37ae62a2035317652fa57.zip
LLDB-MI: -var-list-children with no children doesn't need a children value in the response.
Summary: When using GDB with MI, if there aren't children for a variable, it doesn't include a "children" value in the response. LLDB does and sets it to "[]" while variables with children have an unquoted list: children=[...]. This removes the children value entirely when there are no children making this match GDB in behavior. Test Plan: Ran tests on Mac OS X and they passed. Reviewers: abidh, domipheus Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9320 llvm-svn: 235974
-rw-r--r--lldb/test/tools/lldb-mi/variable/TestMiVar.py8
-rw-r--r--lldb/tools/lldb-mi/MICmdCmdVar.cpp7
2 files changed, 5 insertions, 10 deletions
diff --git a/lldb/test/tools/lldb-mi/variable/TestMiVar.py b/lldb/test/tools/lldb-mi/variable/TestMiVar.py
index 93e1b87cfc3..543278fef67 100644
--- a/lldb/test/tools/lldb-mi/variable/TestMiVar.py
+++ b/lldb/test/tools/lldb-mi/variable/TestMiVar.py
@@ -47,7 +47,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase):
self.runCmd("-var-show-attributes var2")
self.expect("\^done,status=\"editable\"")
self.runCmd("-var-list-children var2")
- self.expect("\^done,numchild=\"0\",children=\"\[\]\"")
+ self.expect("\^done,numchild=\"0\"")
self.runCmd("-data-evaluate-expression \"g_MyVar=30\"")
self.expect("\^done,value=\"30\"")
self.runCmd("-var-update --all-values var2")
@@ -67,7 +67,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase):
self.runCmd("-var-show-attributes var3")
self.expect("\^done,status=\"editable\"")
self.runCmd("-var-list-children var3")
- self.expect("\^done,numchild=\"0\",children=\"\[\]\"")
+ self.expect("\^done,numchild=\"0\"")
self.runCmd("-data-evaluate-expression \"s_MyVar=3\"")
self.expect("\^done,value=\"3\"")
self.runCmd("-var-update --all-values var3")
@@ -87,7 +87,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase):
self.runCmd("-var-show-attributes var4")
self.expect("\^done,status=\"editable\"")
self.runCmd("-var-list-children var4")
- self.expect("\^done,numchild=\"0\",children=\"\[\]\"")
+ self.expect("\^done,numchild=\"0\"")
self.runCmd("-data-evaluate-expression \"b=2\"")
self.expect("\^done,value=\"2\"")
self.runCmd("-var-update --all-values var4")
@@ -107,7 +107,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase):
self.runCmd("-var-show-attributes var5")
self.expect("\^done,status=\"editable\"") #FIXME editable or not?
self.runCmd("-var-list-children var5")
- self.expect("\^done,numchild=\"0\",children=\"\[\]\"")
+ self.expect("\^done,numchild=\"0\"")
# Print argument "argv[0]"
self.runCmd("-data-evaluate-expression \"argv[0]\"")
diff --git a/lldb/tools/lldb-mi/MICmdCmdVar.cpp b/lldb/tools/lldb-mi/MICmdCmdVar.cpp
index dd3f196c363..83071fbde26 100644
--- a/lldb/tools/lldb-mi/MICmdCmdVar.cpp
+++ b/lldb/tools/lldb-mi/MICmdCmdVar.cpp
@@ -1099,12 +1099,7 @@ CMICmdCmdVarListChildren::Acknowledge(void)
CMICmnMIValueResult miValueResult("numchild", miValueConst);
VecMIValueResult_t::const_iterator it = m_vecMiValueResult.begin();
- if (it == m_vecMiValueResult.end())
- {
- const CMICmnMIValueConst miValueConst("[]");
- miValueResult.Add("children", miValueConst);
- }
- else
+ if (it != m_vecMiValueResult.end())
{
CMICmnMIValueList miValueList(*it);
++it;
OpenPOWER on IntegriCloud