Author: labath Date: Tue Apr 12 04:06:08 2016 New Revision: 266050 URL: http://llvm.org/viewvc/llvm-project?rev=266050&view=rev Log: Revert "Restore the lazy initialization of ScriptInterpreterPython, which was lost as part of the SystemLifetimeManager work"
This change breaks python unit tests. This reverts commit 266033. Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp?rev=266050&r1=266049&r2=266050&view=diff ============================================================================== --- lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp (original) +++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp Tue Apr 12 04:06:08 2016 @@ -274,8 +274,8 @@ ScriptInterpreterPython::ScriptInterpret m_lock_count(0), m_command_thread_state(nullptr) { - InitializePrivate(); - + assert(g_initialized && "ScriptInterpreterPython created but InitializePrivate has not been called!"); + m_dictionary_name.append("_dict"); StreamString run_string; run_string.Printf ("%s = dict()", m_dictionary_name.c_str()); @@ -330,6 +330,8 @@ ScriptInterpreterPython::Initialize() std::call_once(g_once_flag, []() { + InitializePrivate(); + PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), lldb::eScriptLanguagePython, @@ -3095,9 +3097,7 @@ ScriptInterpreterPython::InitializeInter void ScriptInterpreterPython::InitializePrivate () { - if (g_initialized) - return; - + assert(!g_initialized && "ScriptInterpreterPython::InitializePrivate() called more than once!"); g_initialized = true; Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__); Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h?rev=266050&r1=266049&r2=266050&view=diff ============================================================================== --- lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h (original) +++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h Tue Apr 12 04:06:08 2016 @@ -372,6 +372,9 @@ public: void ResetOutputFileHandle(FILE *new_fh) override; static void + InitializePrivate (); + + static void InitializeInterpreter (SWIGInitCallback python_swig_init_callback, SWIGBreakpointCallbackFunction swig_breakpoint_callback, SWIGWatchpointCallbackFunction swig_watchpoint_callback, @@ -504,9 +507,6 @@ public: }; protected: - static void - InitializePrivate (); - class SynchronicityHandler { private: _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits