diff options
Diffstat (limited to 'plugins/pychrysalide/debug/debugger.c')
-rw-r--r-- | plugins/pychrysalide/debug/debugger.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/plugins/pychrysalide/debug/debugger.c b/plugins/pychrysalide/debug/debugger.c index 5d8181f..0a7f97c 100644 --- a/plugins/pychrysalide/debug/debugger.c +++ b/plugins/pychrysalide/debug/debugger.c @@ -33,6 +33,7 @@ #include <debug/debugger.h> +#include "../access.h" #include "../helpers.h" #include "../arch/vmpa.h" @@ -1168,17 +1169,24 @@ PyTypeObject *get_python_binary_debugger_type(void) * * ******************************************************************************/ -bool register_python_binary_debugger(PyObject *module) +bool ensure_python_binary_debugger_is_registered(void) { - PyTypeObject *py_binary_debugger_type; /* Type Python 'BinaryDebugger'*/ + PyTypeObject *type; /* Type Python 'BinaryDebugger'*/ + PyObject *module; /* Module à recompléter */ PyObject *dict; /* Dictionnaire du module */ - py_binary_debugger_type = get_python_binary_debugger_type(); + type = get_python_binary_debugger_type(); - dict = PyModule_GetDict(module); + if (!PyType_HasFeature(type, Py_TPFLAGS_READY)) + { + module = get_access_to_python_module("pychrysalide.debug"); + + dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_BINARY_DEBUGGER, py_binary_debugger_type, &PyGObject_Type)) - return false; + if (!register_class_for_pygobject(dict, G_TYPE_BINARY_DEBUGGER, type, &PyGObject_Type)) + return false; + + } return true; |