[Lldb-commits] [lldb] r183772 - <rdar://problem/13759177>

Enrico Granata egranata at apple.com
Tue Jun 11 12:04:33 PDT 2013


Author: enrico
Date: Tue Jun 11 14:04:32 2013
New Revision: 183772

URL: http://llvm.org/viewvc/llvm-project?rev=183772&view=rev
Log:
<rdar://problem/13759177>

Allowing LLDB to resolve names of Python functions when they are located in classes
This allows things like *bound* classmethods to be used for formatters, commands, ...


Modified:
    lldb/trunk/scripts/Python/python-wrapper.swig

Modified: lldb/trunk/scripts/Python/python-wrapper.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-wrapper.swig?rev=183772&r1=183771&r2=183772&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/python-wrapper.swig (original)
+++ lldb/trunk/scripts/Python/python-wrapper.swig Tue Jun 11 14:04:32 2013
@@ -45,7 +45,13 @@ ResolvePythonName(const char* name,
             return NULL;
     }
 
-    if (!PyDict_Check(pmodule))
+    if (PyType_Check(pmodule))
+    {
+        main_dict = ((PyTypeObject*)pmodule)->tp_dict;
+        if (!main_dict)
+            return NULL;
+    }
+    else if (!PyDict_Check(pmodule))
     {
         main_dict = PyModule_GetDict (pmodule);
         if (!main_dict)





More information about the lldb-commits mailing list