diff options
author | Enrico Granata <egranata@apple.com> | 2012-10-29 21:18:03 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2012-10-29 21:18:03 +0000 |
commit | b588726ec976f38ceacb8ae2aff97c2631073142 (patch) | |
tree | 8d310ea112804f62135cfd68090e48a030abc5b2 /lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | 8f4d7eb518d7dd6309de9f0f1211b04265e8b1fd (diff) | |
download | bcm5719-llvm-b588726ec976f38ceacb8ae2aff97c2631073142.tar.gz bcm5719-llvm-b588726ec976f38ceacb8ae2aff97c2631073142.zip |
<rdar://problem/11449953> Change Debugger::SetOutputFileHandle() so that it does not automatically initialize the script interpreter in order to transfer its output file handle to it
This should delay initialization of Python until strictly necessary and speed-up debugger startup
Also, convert formatters for SEL and BOOL ObjC data-types from Python to C++, in order to reap more performance benefits from the above changes
llvm-svn: 166967
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index ed7e60da758..9fde66e4dba 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -40,23 +40,28 @@ #include "../Commands/CommandObjectVersion.h" #include "../Commands/CommandObjectWatchpoint.h" -#include "lldb/Interpreter/Args.h" -#include "lldb/Interpreter/Options.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/InputReader.h" +#include "lldb/Core/Log.h" #include "lldb/Core/Stream.h" #include "lldb/Core/Timer.h" + #include "lldb/Host/Host.h" -#include "lldb/Target/Process.h" -#include "lldb/Target/Thread.h" -#include "lldb/Target/TargetList.h" -#include "lldb/Utility/CleanUp.h" +#include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Interpreter/Options.h" #include "lldb/Interpreter/ScriptInterpreterNone.h" #include "lldb/Interpreter/ScriptInterpreterPython.h" + +#include "lldb/Target/Process.h" +#include "lldb/Target/Thread.h" +#include "lldb/Target/TargetList.h" + +#include "lldb/Utility/CleanUp.h" + using namespace lldb; using namespace lldb_private; @@ -2547,8 +2552,14 @@ CommandInterpreter::HandleCommandsFromFile (FileSpec &cmd_file, } ScriptInterpreter * -CommandInterpreter::GetScriptInterpreter () +CommandInterpreter::GetScriptInterpreter (bool can_create) { + if (m_script_interpreter_ap.get() != NULL) + return m_script_interpreter_ap.get(); + + if (!can_create) + return NULL; + // <rdar://problem/11751427> // we need to protect the initialization of the script interpreter // otherwise we could end up with two threads both trying to create @@ -2559,8 +2570,9 @@ CommandInterpreter::GetScriptInterpreter () static Mutex g_interpreter_mutex(Mutex::eMutexTypeRecursive); Mutex::Locker interpreter_lock(g_interpreter_mutex); - if (m_script_interpreter_ap.get() != NULL) - return m_script_interpreter_ap.get(); + LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); + if (log) + log->Printf("Initializing the ScriptInterpreter now\n"); lldb::ScriptLanguage script_lang = GetDebugger().GetScriptLanguage(); switch (script_lang) |