[Lldb-commits] [lldb] r138281 - in /lldb/trunk: source/Commands/CommandObjectTarget.cpp test/help/TestHelp.py

Johnny Chen johnny.chen at apple.com
Mon Aug 22 15:22:00 PDT 2011


Author: johnny
Date: Mon Aug 22 17:22:00 2011
New Revision: 138281

URL: http://llvm.org/viewvc/llvm-project?rev=138281&view=rev
Log:
Fix the 'target variable' help syntax to output one or more <variable-name>'s.
Add a simple test case for that.

Modified:
    lldb/trunk/source/Commands/CommandObjectTarget.cpp
    lldb/trunk/test/help/TestHelp.py

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=138281&r1=138280&r2=138281&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Mon Aug 22 17:22:00 2011
@@ -538,6 +538,19 @@
         m_option_shared_libraries (LLDB_OPT_SET_1, false, "shlib",'s', 0, eArgTypePath, "A basename or fullpath to a shared library to use in the search for global variables. This option can be specified multiple times."),
         m_varobj_options()
     {
+        CommandArgumentEntry arg;
+        CommandArgumentData var_name_arg;
+        
+        // Define the first (and only) variant of this arg.
+        var_name_arg.arg_type = eArgTypeVarName;
+        var_name_arg.arg_repetition = eArgRepeatPlus;
+        
+        // There is only one variant this argument could be; put it into the argument entry.
+        arg.push_back (var_name_arg);
+        
+        // Push the data for the first argument into the m_arguments vector.
+        m_arguments.push_back (arg);
+        
         m_option_group.Append (&m_varobj_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
         m_option_group.Append (&m_option_variable, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
         m_option_group.Append (&m_option_compile_units, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);   

Modified: lldb/trunk/test/help/TestHelp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/help/TestHelp.py?rev=138281&r1=138280&r2=138281&view=diff
==============================================================================
--- lldb/trunk/test/help/TestHelp.py (original)
+++ lldb/trunk/test/help/TestHelp.py Mon Aug 22 17:22:00 2011
@@ -93,6 +93,11 @@
         self.expect("help image du line",
             substrs = ['Dump the debug symbol file for one or more target modules'])
 
+    def test_help_target_variable_syntax(self):
+        """Command 'help target variable' should display <variable-name> ..."""
+        self.expect("help target variable",
+            substrs = ['<variable-name> [<variable-name> [...]]'])
+
 
 if __name__ == '__main__':
     import atexit





More information about the lldb-commits mailing list