[Lldb-commits] [lldb] r181537 - <rdar://problem/13831149>

Enrico Granata egranata at apple.com
Thu May 9 12:33:49 PDT 2013


Author: enrico
Date: Thu May  9 14:33:49 2013
New Revision: 181537

URL: http://llvm.org/viewvc/llvm-project?rev=181537&view=rev
Log:
<rdar://problem/13831149>

Recursive commands invocations are not currently supported by our CommandInterpreter
CommandScriptImport can actually be made to invoke itself recursively, so we need to work around that by clearing the m_exe_ctx
This is a short-term workaround, a more interesting solution would be to actually make sure recursive command invocations work properly

Modified:
    lldb/trunk/source/Commands/CommandObjectCommands.cpp

Modified: lldb/trunk/source/Commands/CommandObjectCommands.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectCommands.cpp?rev=181537&r1=181536&r2=181537&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectCommands.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectCommands.cpp Thu May  9 14:33:49 2013
@@ -1397,6 +1397,13 @@ protected:
         Error error;
         
         const bool init_session = true;
+        // FIXME: this is necessary because CommandObject::CheckRequirements() assumes that
+        // commands won't ever be recursively invoked, but it's actually possible to craft
+        // a Python script that does other "command script imports" in __lldb_init_module
+        // the real fix is to have recursive commands possible with a CommandInvocation object
+        // separate from the CommandObject itself, so that recursive command invocations
+        // won't stomp on each other (wrt to execution contents, options, and more)
+        m_exe_ctx.Clear();
         if (m_interpreter.GetScriptInterpreter()->LoadScriptingModule(path.c_str(),
                                                                       m_options.m_allow_reload,
                                                                       init_session,





More information about the lldb-commits mailing list