diff options
author | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2008-10-16 03:54:00 +0000 |
---|---|---|
committer | Thiago Jung Bauermann <bauerman@br.ibm.com> | 2008-10-16 03:54:00 +0000 |
commit | a08702d64763b3c67aafc3f10b0e077187a8e551 (patch) | |
tree | 550e4419773f8ac106aa49ca60dbb72e3eafc4fc /gdb/testsuite/gdb.python/python-value.c | |
parent | merge from gcc (diff) | |
download | binutils-gdb-a08702d64763b3c67aafc3f10b0e077187a8e551.tar.gz binutils-gdb-a08702d64763b3c67aafc3f10b0e077187a8e551.tar.bz2 binutils-gdb-a08702d64763b3c67aafc3f10b0e077187a8e551.zip |
2008-10-16 Thiago Jung Bauermann <bauerman@br.ibm.com>
Tom Tromey <tromey@redhat.com>
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.
Diffstat (limited to 'gdb/testsuite/gdb.python/python-value.c')
-rw-r--r-- | gdb/testsuite/gdb.python/python-value.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/python-value.c b/gdb/testsuite/gdb.python/python-value.c new file mode 100644 index 00000000000..82cfd9af43f --- /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 <http://www.gnu.org/licenses/>. */ + +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 */ +} |