[Lldb-commits] [lldb] r148500 - in /lldb/trunk: include/lldb/Interpreter/CommandObject.h source/Commands/CommandObjectSettings.h source/Interpreter/CommandObject.cpp

Johnny Chen johnny.chen at apple.com
Thu Jan 19 14:16:06 PST 2012


Author: johnny
Date: Thu Jan 19 16:16:06 2012
New Revision: 148500

URL: http://llvm.org/viewvc/llvm-project?rev=148500&view=rev
Log:
rdar://problem/10724187

http://llvm.org/viewvc/llvm-project?rev=148491&view=rev check in broke the argument completion
for "settings set th", followed by TAB.  Provide a way for commands who want raw commands to
hook into the completion mechanism.

Modified:
    lldb/trunk/include/lldb/Interpreter/CommandObject.h
    lldb/trunk/source/Commands/CommandObjectSettings.h
    lldb/trunk/source/Interpreter/CommandObject.cpp

Modified: lldb/trunk/include/lldb/Interpreter/CommandObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandObject.h?rev=148500&r1=148499&r2=148500&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/CommandObject.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandObject.h Thu Jan 19 16:16:06 2012
@@ -141,6 +141,12 @@
     virtual bool
     WantsRawCommandString() { return false; }
 
+    // By default, WantsCompletion = !WantsRawCommandString.
+    // Subclasses who want raw command string but desire, for example,
+    // argument completion should override this method to return true.
+    virtual bool
+    WantsCompletion() { return !WantsRawCommandString(); }
+
     virtual Options *
     GetOptions ();
 

Modified: lldb/trunk/source/Commands/CommandObjectSettings.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSettings.h?rev=148500&r1=148499&r2=148500&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectSettings.h (original)
+++ lldb/trunk/source/Commands/CommandObjectSettings.h Thu Jan 19 16:16:06 2012
@@ -56,6 +56,10 @@
     virtual bool
     WantsRawCommandString() { return true; }
 
+    // Overrides base class's behavior where WantsCompletion = !WantsRawCommandString.
+    virtual bool
+    WantsCompletion() { return true; }
+
     virtual bool
     ExecuteRawCommandString (const char *raw_command,
                              CommandReturnObject &result);

Modified: lldb/trunk/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObject.cpp?rev=148500&r1=148499&r2=148500&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandObject.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandObject.cpp Thu Jan 19 16:16:06 2012
@@ -344,7 +344,7 @@
     StringList &matches
 )
 {
-    if (WantsRawCommandString())
+    if (WantsRawCommandString() && !WantsCompletion())
     {
         // FIXME: Abstract telling the completion to insert the completion character.
         matches.Clear();





More information about the lldb-commits mailing list