summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/debug/gdbrsp/gdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/debug/gdbrsp/gdb.c')
-rw-r--r--plugins/pychrysalide/debug/gdbrsp/gdb.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/plugins/pychrysalide/debug/gdbrsp/gdb.c b/plugins/pychrysalide/debug/gdbrsp/gdb.c
index a4cde20..df56ca4 100644
--- a/plugins/pychrysalide/debug/gdbrsp/gdb.c
+++ b/plugins/pychrysalide/debug/gdbrsp/gdb.c
@@ -35,6 +35,7 @@
#include "../debugger.h"
+#include "../../access.h"
#include "../../helpers.h"
#include "../../analysis/binary.h"
@@ -148,18 +149,24 @@ PyTypeObject *get_python_gdb_debugger_type(void)
* *
******************************************************************************/
-bool register_python_gdb_debugger(PyObject *module)
+bool ensure_python_gdb_debugger_is_registered(void)
{
- PyTypeObject *py_gdb_debugger_type; /* Type Python 'GdbDebugger' */
+ PyTypeObject *type; /* Type Python 'GdbDebugger' */
+ PyObject *module; /* Module à recompléter */
PyObject *dict; /* Dictionnaire du module */
- py_gdb_debugger_type = get_python_gdb_debugger_type();
+ type = get_python_gdb_debugger_type();
- dict = PyModule_GetDict(module);
+ if (!PyType_HasFeature(type, Py_TPFLAGS_READY))
+ {
+ module = get_access_to_python_module("pychrysalide.debug.gdbrsp");
+
+ dict = PyModule_GetDict(module);
- if (!register_class_for_pygobject(dict, G_TYPE_GDB_DEBUGGER,
- py_gdb_debugger_type, get_python_binary_debugger_type()))
- return false;
+ if (!register_class_for_pygobject(dict, G_TYPE_GDB_DEBUGGER, type, get_python_binary_debugger_type()))
+ return false;
+
+ }
return true;