diff options
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/python-internal.h | 13 | ||||
-rw-r--r-- | gdb/python/python.c | 4 | ||||
-rw-r--r-- | gdb/python/python.h | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index f850448..72f7a5f 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -43,11 +43,18 @@ typedef Py_intptr_t Py_ssize_t; #error "Unable to find usable Python.h" #endif -struct block; -struct symbol; -struct symtab_and_line; +struct value; extern PyObject *gdb_module; +extern PyTypeObject value_object_type; + +PyObject *gdbpy_get_value_from_history (PyObject *self, PyObject *args); + +PyObject *value_to_value_object (struct value *v); + +struct value *convert_value_from_python (PyObject *obj); + +void gdbpy_initialize_values (void); struct cleanup *make_cleanup_py_decref (PyObject *py); diff --git a/gdb/python/python.c b/gdb/python/python.c index 8bc24c2..77d8774 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -52,6 +52,8 @@ static PyObject *gdbpy_flush (PyObject *, PyObject *); static PyMethodDef GdbMethods[] = { + { "get_value_from_history", gdbpy_get_value_from_history, METH_VARARGS, + "Get a value from history" }, { "execute", execute_gdb_command, METH_VARARGS, "Execute a gdb command" }, { "get_parameter", get_parameter, METH_VARARGS, @@ -398,6 +400,8 @@ Enables or disables printing of Python stack traces."), PyModule_AddStringConstant (gdb_module, "HOST_CONFIG", (char*) host_name); PyModule_AddStringConstant (gdb_module, "TARGET_CONFIG", (char*) target_name); + gdbpy_initialize_values (); + PyRun_SimpleString ("import gdb"); /* Create a couple objects which are used for Python's stdout and diff --git a/gdb/python/python.h b/gdb/python/python.h index 00ff159..102fef6 100644 --- a/gdb/python/python.h +++ b/gdb/python/python.h @@ -22,6 +22,8 @@ #include "value.h" +extern struct value *values_in_python; + void eval_python_from_control_command (struct command_line *); #endif /* GDB_PYTHON_H */ |