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/testsuite/gdb.python/python-value.c | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 gdb/testsuite/gdb.python/python-value.c (limited to 'gdb/testsuite/gdb.python/python-value.c') diff --git a/gdb/testsuite/gdb.python/python-value.c b/gdb/testsuite/gdb.python/python-value.c new file mode 100644 index 0000000..82cfd9a --- /dev/null +++ b/gdb/testsuite/gdb.python/python-value.c @@ -0,0 +1,41 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2008 Free Software Foundation, Inc. + + This program 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. + + This program 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, see . */ + +struct s +{ + int a; + int b; +}; + +union u +{ + int a; + float b; +}; + +int +main (int argc, char *argv[]) +{ + struct s s; + union u u; + + s.a = 3; + s.b = 5; + u.a = 7; + + return 0; /* break to inspect struct and union */ +} -- cgit v1.1