<div dir="ltr">This breaks the python unit tests. Doesn't seem hard to fix, it seems we just need some way to "really" initialize python before we run the tests. However, I have reverted this change until that happens to keep to bots green.<div><br></div><div>pl</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 April 2016 at 02:41, Enrico Granata via lldb-commits <span dir="ltr"><<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Apr 11, 2016, at 6:28 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div><br><div>I have a feeling this breaks something, but I'm not sure what.  I remember specifically needing this for some reason.<br><br></div></blockquote><div><br></div></span><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><span class=""><br><blockquote type="cite"><div>Did you verify that the gtest suite</div></blockquote><div><br></div></span><div>No - but I believe the bots run it, so I will probably get yelled at soon if I broke something</div><span class=""><br><blockquote type="cite"><div> as well as the dotest suite</div></blockquote><div><br></div></span><div>Yes</div><span class=""><br><blockquote type="cite"><div> and the interactive interpreter all still pass / work?<br></div></blockquote><div><br></div></span><div>Yes</div><div><div class="h5"><br><blockquote type="cite"><div><div class="gmail_quote"><div dir="ltr">On Mon, Apr 11, 2016 at 6:14 PM Enrico Granata via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: enrico<br>
Date: Mon Apr 11 20:08:35 2016<br>
New Revision: 266033<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=266033&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=266033&view=rev</a><br>
Log:<br>
Restore the lazy initialization of ScriptInterpreterPython, which was lost as part of the SystemLifetimeManager work<br>
<br>
<br>
Modified:<br>
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp<br>
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h<br>
<br>
Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp<br>
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">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp?rev=266033&r1=266032&r2=266033&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp (original)<br>
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp Mon Apr 11 20:08:35 2016<br>
@@ -274,8 +274,8 @@ ScriptInterpreterPython::ScriptInterpret<br>
     m_lock_count(0),<br>
     m_command_thread_state(nullptr)<br>
 {<br>
-    assert(g_initialized && "ScriptInterpreterPython created but InitializePrivate has not been called!");<br>
-<br>
+    InitializePrivate();<br>
+<br>
     m_dictionary_name.append("_dict");<br>
     StreamString run_string;<br>
     run_string.Printf ("%s = dict()", m_dictionary_name.c_str());<br>
@@ -330,8 +330,6 @@ ScriptInterpreterPython::Initialize()<br>
<br>
     std::call_once(g_once_flag, []()<br>
     {<br>
-        InitializePrivate();<br>
-<br>
         PluginManager::RegisterPlugin(GetPluginNameStatic(),<br>
                                       GetPluginDescriptionStatic(),<br>
                                       lldb::eScriptLanguagePython,<br>
@@ -3097,7 +3095,9 @@ ScriptInterpreterPython::InitializeInter<br>
 void<br>
 ScriptInterpreterPython::InitializePrivate ()<br>
 {<br>
-    assert(!g_initialized && "ScriptInterpreterPython::InitializePrivate() called more than once!");<br>
+    if (g_initialized)<br>
+        return;<br>
+<br>
     g_initialized = true;<br>
<br>
     Timer scoped_timer (__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);<br>
<br>
Modified: lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h<br>
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">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h?rev=266033&r1=266032&r2=266033&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h (original)<br>
+++ lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h Mon Apr 11 20:08:35 2016<br>
@@ -372,9 +372,6 @@ public:<br>
     void ResetOutputFileHandle(FILE *new_fh) override;<br>
<br>
     static void<br>
-    InitializePrivate ();<br>
-<br>
-    static void<br>
     InitializeInterpreter (SWIGInitCallback python_swig_init_callback,<br>
                            SWIGBreakpointCallbackFunction swig_breakpoint_callback,<br>
                            SWIGWatchpointCallbackFunction swig_watchpoint_callback,<br>
@@ -507,6 +504,9 @@ public:<br>
     };<br>
<br>
 protected:<br>
+    static void<br>
+    InitializePrivate ();<br>
+<br>
     class SynchronicityHandler<br>
     {<br>
     private:<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>
</div></blockquote></div></div></div><br><div>
<div 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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>Thanks,</div><div 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;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><i>- Enrico</i><br>📩 egranata@<font color="#ff2600"></font>.com ☎️ 27683</div>
</div>
<br></div><br>_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
<br></blockquote></div><br></div>