From b588726ec976f38ceacb8ae2aff97c2631073142 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Mon, 29 Oct 2012 21:18:03 +0000 Subject: 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 --- lldb/source/Interpreter/ScriptInterpreterPython.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index fdd406a764ab..9457ef9e24c5 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -501,6 +501,11 @@ ScriptInterpreterPython::ScriptInterpreterPython (CommandInterpreter &interprete { m_new_sysout = PyFile_FromFile (m_dbg_stdout, (char *) "", (char *) "w", _check_and_flush); } + + // get the output file handle from the debugger (if any) + File& out_file = interpreter.GetDebugger().GetOutputFile(); + if (out_file.IsValid()) + ResetOutputFileHandle(out_file.GetStream()); } ScriptInterpreterPython::~ScriptInterpreterPython () -- cgit v1.2.3