diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-02-01 10:12:54 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-02-01 10:12:54 (GMT) |
commit | 0c847f961a99d8e8012beecad27cf4318df1ff88 (patch) | |
tree | e73689b844184f272267ae54ac27a6e826410478 /plugins/pyoida/debug/module.c | |
parent | 14e82ed268cb78d62bbba93357fede5ece5c4f7d (diff) |
Provided a debug module for Python plugins using the PyGObject API.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@232 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/pyoida/debug/module.c')
-rw-r--r-- | plugins/pyoida/debug/module.c | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/plugins/pyoida/debug/module.c b/plugins/pyoida/debug/module.c new file mode 100644 index 0000000..fe59595 --- /dev/null +++ b/plugins/pyoida/debug/module.c @@ -0,0 +1,66 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * module.c - intégration du répertoire debug en tant que module + * + * Copyright (C) 2012 Cyrille Bagard + * + * This file is part of OpenIDA. + * + * OpenIDA is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * OpenIDA is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "module.h" + + +#include "debugger.h" + + + +/****************************************************************************** +* * +* Paramètres : module = module dont la définition est à compléter. * +* * +* Description : Ajoute le module 'debug' au module Python. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +bool add_debug_module_to_python_module(PyObject *super) +{ + bool result; + PyObject *module; + int ret; /* Bilan d'un appel */ + + static PyMethodDef py_analysis_methods[] = { + { NULL } + }; + + module = Py_InitModule("pychrysalide.debug", py_analysis_methods); + if (module == NULL) return false; + + Py_INCREF(module); + ret = PyModule_AddObject(super, "pychrysalide.debug", module); + + result = (ret != 0); + + result &= register_python_binary_debugger(module); + + return result; + +} |