summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2016-04-12 18:23:18 +0000
committerEnrico Granata <egranata@apple.com>2016-04-12 18:23:18 +0000
commit15d1b4e2aab9159a8cc56b49eb68f1a82e4ebe90 (patch)
tree218da3d01187b8bee2ef6c9d227d120860f6d0da /lldb/source/Plugins/ScriptInterpreter/Python
parentb390d8ee3980f729d1dc777c0cf422a2d72eb625 (diff)
downloadbcm5719-llvm-15d1b4e2aab9159a8cc56b49eb68f1a82e4ebe90.tar.gz
bcm5719-llvm-15d1b4e2aab9159a8cc56b49eb68f1a82e4ebe90.zip
Initialize the Python script interpreter lazily (i.e. not at debugger startup)
This time it should also pass the gtests llvm-svn: 266103
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 0af1fd53ac8..4cf42598d32 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -274,7 +274,7 @@ ScriptInterpreterPython::ScriptInterpreterPython(CommandInterpreter &interpreter
m_lock_count(0),
m_command_thread_state(nullptr)
{
- assert(g_initialized && "ScriptInterpreterPython created but InitializePrivate has not been called!");
+ InitializePrivate();
m_dictionary_name.append("_dict");
StreamString run_string;
@@ -330,8 +330,6 @@ ScriptInterpreterPython::Initialize()
std::call_once(g_once_flag, []()
{
- InitializePrivate();
-
PluginManager::RegisterPlugin(GetPluginNameStatic(),
GetPluginDescriptionStatic(),
lldb::eScriptLanguagePython,
@@ -3097,7 +3095,9 @@ ScriptInterpreterPython::InitializeInterpreter (SWIGInitCallback swig_init_callb
void
ScriptInterpreterPython::InitializePrivate ()
{
- assert(!g_initialized && "ScriptInterpreterPython::InitializePrivate() called more than once!");
+ if (g_initialized)
+ return;
+
g_initialized = true;
Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);
OpenPOWER on IntegriCloud