[CalendarServer-changes] [15299] CalendarServer/trunk/contrib/tools/lldb_utils.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Nov 6 20:54:31 PST 2015


Revision: 15299
          http://trac.calendarserver.org//changeset/15299
Author:   dre at apple.com
Date:     2015-11-06 20:54:31 -0800 (Fri, 06 Nov 2015)
Log Message:
-----------
repr() on python arrays needs the GIL

Modified Paths:
--------------
    CalendarServer/trunk/contrib/tools/lldb_utils.py

Modified: CalendarServer/trunk/contrib/tools/lldb_utils.py
===================================================================
--- CalendarServer/trunk/contrib/tools/lldb_utils.py	2015-11-06 23:19:19 UTC (rev 15298)
+++ CalendarServer/trunk/contrib/tools/lldb_utils.py	2015-11-07 04:54:31 UTC (rev 15299)
@@ -155,6 +155,7 @@
         print("Current frame is not a Python function")
         return
     print("Locals in frame #{}".format(frame.GetFrameID()))
+    tstate = frame.EvaluateExpression("PyGILState_Ensure()")
     names = f.GetValueForExpressionPath("->f_code->co_varnames").Cast(pytuple_t)
     for i in range(numlocals):
         localname = _toStr(names.GetValueForExpressionPath("->ob_item[{}]".format(i)), pystring_t)
@@ -165,6 +166,7 @@
             localname[1:-1] if localname else ".",
             local[1:-1] if local else ".",
         ))
+    frame.EvaluateExpression("PyGILState_Release({})".format(tstate))
 
 
 CMDS = ("pybt", "pybtall", "pylocals",)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20151106/791fcfff/attachment.html>


More information about the calendarserver-changes mailing list