[Lldb-commits] [lldb] r254941 - Allow variable names to be quoted with -var-list-children

Chuck Ries via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 7 12:43:53 PST 2015


Author: chuckr
Date: Mon Dec  7 14:43:52 2015
New Revision: 254941

URL: http://llvm.org/viewvc/llvm-project?rev=254941&view=rev
Log:
Allow variable names to be quoted with -var-list-children

Allow both '-var-list-children var0' and '-var-list-children "var0"' to be used with the -var-list-children command. GDB MI allows for this and it is necessary if the variable name contains spaces, such as var5.std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<cahr> > > >.

Differential Revision: http://reviews.llvm.org/D15168

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
    lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py?rev=254941&r1=254940&r2=254941&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py Mon Dec  7 14:43:52 2015
@@ -49,6 +49,9 @@ class MiVarTestCase(lldbmi_testcase.MiTe
         self.expect("\^done,status=\"editable\"")
         self.runCmd("-var-list-children var2")
         self.expect("\^done,numchild=\"0\",has_more=\"0\"")
+        # Ensure -var-list-children also works with quotes
+        self.runCmd("-var-list-children \"var2\"")
+        self.expect("\^done,numchild=\"0\",has_more=\"0\"")
         self.runCmd("-data-evaluate-expression \"g_MyVar=30\"")
         self.expect("\^done,value=\"30\"")
         self.runCmd("-var-update --all-values var2")

Modified: lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp?rev=254941&r1=254940&r2=254941&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp Mon Dec  7 14:43:52 2015
@@ -945,7 +945,7 @@ bool
 CMICmdCmdVarListChildren::ParseArgs()
 {
     m_setCmdArgs.Add(new CMICmdArgValPrintValues(m_constStrArgPrintValues, false, true));
-    m_setCmdArgs.Add(new CMICmdArgValString(m_constStrArgName, true, true));
+    m_setCmdArgs.Add(new CMICmdArgValString(m_constStrArgName, true, true, true));
     m_setCmdArgs.Add(new CMICmdArgValNumber(m_constStrArgFrom, false, true));
     m_setCmdArgs.Add(new CMICmdArgValNumber(m_constStrArgTo, false, true));
     return ParseValidateCmdOptions();




More information about the lldb-commits mailing list