<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 11, 2016, at 6:28 PM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">I have a feeling this breaks something, but I'm not sure what.  I remember specifically needing this for some reason.<br class=""><br class=""></div></blockquote><div><br class=""></div><div>If you manage to repro the breakage, let’s work on getting it fixed</div><div>I’d like to not have to initialize Python eagerly - most users will probably not touch anything Python during debugging, and I have seen a few spin dumps connected to the eager initialization during debugging startup</div><br class=""><blockquote type="cite" class=""><div class="">Did you verify that the gtest suite</div></blockquote><div><br class=""></div><div>No - but I believe the bots run it, so I will probably get yelled at soon if I broke something</div><br class=""><blockquote type="cite" class=""><div class=""> as well as the dotest suite</div></blockquote><div><br class=""></div><div>Yes</div><br class=""><blockquote type="cite" class=""><div class=""> and the interactive interpreter all still pass / work?<br class=""></div></blockquote><div><br class=""></div><div>Yes</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Apr 11, 2016 at 6:14 PM Enrico Granata via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: enrico<br class="">
Date: Mon Apr 11 20:08:35 2016<br class="">
New Revision: 266033<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=266033&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=266033&view=rev</a><br class="">
Log:<br class="">
Restore the lazy initialization of ScriptInterpreterPython, which was lost as part of the SystemLifetimeManager work<br class="">
<br class="">
<br class="">
Modified:<br class="">
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp<br class="">
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h<br class="">
<br class="">
Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp?rev=266033&r1=266032&r2=266033&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp?rev=266033&r1=266032&r2=266033&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp (original)<br class="">
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp Mon Apr 11 20:08:35 2016<br class="">
@@ -274,8 +274,8 @@ ScriptInterpreterPython::ScriptInterpret<br class="">
     m_lock_count(0),<br class="">
     m_command_thread_state(nullptr)<br class="">
 {<br class="">
-    assert(g_initialized && "ScriptInterpreterPython created but InitializePrivate has not been called!");<br class="">
-<br class="">
+    InitializePrivate();<br class="">
+<br class="">
     m_dictionary_name.append("_dict");<br class="">
     StreamString run_string;<br class="">
     run_string.Printf ("%s = dict()", m_dictionary_name.c_str());<br class="">
@@ -330,8 +330,6 @@ ScriptInterpreterPython::Initialize()<br class="">
<br class="">
     std::call_once(g_once_flag, []()<br class="">
     {<br class="">
-        InitializePrivate();<br class="">
-<br class="">
         PluginManager::RegisterPlugin(GetPluginNameStatic(),<br class="">
                                       GetPluginDescriptionStatic(),<br class="">
                                       lldb::eScriptLanguagePython,<br class="">
@@ -3097,7 +3095,9 @@ ScriptInterpreterPython::InitializeInter<br class="">
 void<br class="">
 ScriptInterpreterPython::InitializePrivate ()<br class="">
 {<br class="">
-    assert(!g_initialized && "ScriptInterpreterPython::InitializePrivate() called more than once!");<br class="">
+    if (g_initialized)<br class="">
+        return;<br class="">
+<br class="">
     g_initialized = true;<br class="">
<br class="">
     Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);<br class="">
<br class="">
Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h?rev=266033&r1=266032&r2=266033&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h?rev=266033&r1=266032&r2=266033&view=diff</a><br class="">
==============================================================================<br class="">
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h (original)<br class="">
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h Mon Apr 11 20:08:35 2016<br class="">
@@ -372,9 +372,6 @@ public:<br class="">
     void ResetOutputFileHandle(FILE *new_fh) override;<br class="">
<br class="">
     static void<br class="">
-    InitializePrivate ();<br class="">
-<br class="">
-    static void<br class="">
     InitializeInterpreter (SWIGInitCallback python_swig_init_callback,<br class="">
                            SWIGBreakpointCallbackFunction swig_breakpoint_callback,<br class="">
                            SWIGWatchpointCallbackFunction swig_watchpoint_callback,<br class="">
@@ -507,6 +504,9 @@ public:<br class="">
     };<br class="">
<br class="">
 protected:<br class="">
+    static void<br class="">
+    InitializePrivate ();<br class="">
+<br class="">
     class SynchronicityHandler<br class="">
     {<br class="">
     private:<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
lldb-commits mailing list<br class="">
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank" class="">lldb-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""><div class="">
<div class="" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">Thanks,</div><div class="" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><i class="">- Enrico</i><br class="">📩 egranata@<font color="#ff2600" class=""></font>.com ☎️ 27683</div>
</div>
<br class=""></body></html>