gdb: add a debugging function that enters the python interpreter.
This commit is contained in:
parent
70dbe61ffc
commit
b25e56b32a
1 changed files with 16 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
||||||
* Steve Reinhardt
|
* Steve Reinhardt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <Python.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -106,6 +107,21 @@ eventqDump()
|
||||||
warn("need to dump all queues");
|
warn("need to dump all queues");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
py_interact()
|
||||||
|
{
|
||||||
|
PyObject *globals;
|
||||||
|
PyObject *locals;
|
||||||
|
|
||||||
|
globals = PyEval_GetGlobals();
|
||||||
|
Py_INCREF(globals);
|
||||||
|
locals = PyDict_New();
|
||||||
|
PyRun_String("import code", Py_file_input, globals, locals);
|
||||||
|
PyRun_String("code.interact(local=globals())", Py_file_input,
|
||||||
|
globals, locals);
|
||||||
|
Py_DECREF(globals);
|
||||||
|
Py_DECREF(locals);
|
||||||
|
}
|
||||||
|
|
||||||
int remote_gdb_base_port = 7000;
|
int remote_gdb_base_port = 7000;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue