From a08702d64763b3c67aafc3f10b0e077187a8e551 Mon Sep 17 00:00:00 2001 From: Thiago Jung Bauermann Date: Thu, 16 Oct 2008 03:54:00 +0000 Subject: 2008-10-16 Thiago Jung Bauermann Tom Tromey gdb/ * Makefile.in (SUBDIR_PYTHON_OBS): Add python-value.o. (SUBDIR_PYTHON_SRCS): Add python-value.c. (python-value.o): New target. * configure.ac (CONFIG_OBS): Add python-value.o. (CONFIG_SRCS): Add python/python-value.c * configure: Regenerate. * python-internal.h (value_object_type): Add external declaration. (gdbpy_get_value_from_history, value_to_value_object, convert_value_from_python, gdbpy_initialize_values): Add function prototype. * python/python-value.c: New file. * python/python.c (GdbMethods): Add gdbpy_get_value_from_history. (_initialize_python): Call gdbpy_initialize_values. * python/python.h (values_in_python): Add external declaration. * value.c (value_prepend_to_list, value_remove_from_list): New functions. (preserve_values): Iterate over values_in_python list as well. * value.h (value_prepend_to_list, value_remove_from_list): Add function prototypes. gdb/doc/ * gdb.texinfo. (Values From Inferior): New subsubsection. gdb/testsuite/ * gdb.python/python-value.c: New file. * gdb.python/python-value.exp: New file. --- gdb/python/python.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/python/python.c') 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 -- cgit v1.1