From 078551c7b1b9ea71e32b0c9f87fb547d9f3ed9c7 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Thu, 9 May 2013 19:33:49 +0000 Subject: 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 llvm-svn: 181537 --- lldb/source/Commands/CommandObjectCommands.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lldb/source/Commands/CommandObjectCommands.cpp') diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 75bcfc2..278fdc0 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -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, -- cgit v1.1