changeset 4b50a0d875da in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=4b50a0d875da
description:
        gdb: add a debugging function that enters the python interpreter.

diffstat:

0 files changed

diffs (33 lines):

diff -r 1abb23c038d5 -r 4b50a0d875da src/sim/debug.cc
--- a/src/sim/debug.cc  Fri Oct 10 10:15:01 2008 -0700
+++ b/src/sim/debug.cc  Fri Oct 10 10:15:01 2008 -0700
@@ -29,6 +29,7 @@
  *          Steve Reinhardt
  */
 
+#include <Python.h>
 #include <sys/types.h>
 #include <signal.h>
 #include <unistd.h>
@@ -106,6 +107,21 @@
     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;
 
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to