[Lldb-commits] [lldb] r175798 - Fix CommandObjectMultiword to initialize all members, and beef up corresponding test case.

Daniel Malea daniel.malea at intel.com
Thu Feb 21 13:18:07 PST 2013


Author: dmalea
Date: Thu Feb 21 15:18:07 2013
New Revision: 175798

URL: http://llvm.org/viewvc/llvm-project?rev=175798&view=rev
Log:
Fix CommandObjectMultiword to initialize all members, and beef up corresponding test case.


Modified:
    lldb/trunk/source/Commands/CommandObjectMultiword.cpp
    lldb/trunk/test/functionalities/command_script/TestCommandScript.py

Modified: lldb/trunk/source/Commands/CommandObjectMultiword.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMultiword.cpp?rev=175798&r1=175797&r2=175798&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMultiword.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMultiword.cpp Thu Feb 21 15:18:07 2013
@@ -34,7 +34,8 @@ CommandObjectMultiword::CommandObjectMul
     const char *syntax,
     uint32_t flags
 ) :
-    CommandObject (interpreter, name, help, syntax, flags)
+    CommandObject (interpreter, name, help, syntax, flags),
+    m_can_be_removed(false)
 {
 }
 

Modified: lldb/trunk/test/functionalities/command_script/TestCommandScript.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/command_script/TestCommandScript.py?rev=175798&r1=175797&r2=175798&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/command_script/TestCommandScript.py (original)
+++ lldb/trunk/test/functionalities/command_script/TestCommandScript.py Thu Feb 21 15:18:07 2013
@@ -111,9 +111,20 @@ class CmdPythonTestCase(TestBase):
         self.expect("tell_curr",
                     substrs = ['I am running sync'])
 
+        # Test that a python command can redefine itself
+        self.expect('command script add -f foobar welcome')
 
         self.runCmd("command script clear")
 
+        # Test that re-defining an existing command works
+        self.runCmd('command script add my_command --function welcome.welcome_impl')
+        self.expect('my_command Blah', substrs = ['Hello Blah, welcome to LLDB'])
+
+        self.runCmd('command script add my_command --function welcome.target_name_impl')
+        self.expect('my_command', substrs = ['a.out'])
+
+        self.runCmd("command script clear")
+                
         self.expect('command script list', matching=False,
                     substrs = ['targetname',
                                'longwait'])





More information about the lldb-commits mailing list