1 2005-07-26 Jeff Johnston <jjohnstn@redhat.com>
3 * gdb.cp/b146835.exp: New testcase.
4 * gdb.cp/b146835.cc: Ditto.
5 * gdb.cp/b146835b.cc: Ditto.
6 * gdb.cp/b146835.h: Ditto.
8 Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835b.cc
9 ===================================================================
10 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
11 +++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835b.cc 2009-08-12 06:07:50.000000000 +0200
15 +C::C() { d = 0; x = 3; }
17 +int C::z (char *s) { return 0; }
21 +void A::funcD (class E *e, class D *d) {}
22 +void A::funcE (E *e, D *d) {}
23 +void A::funcF (unsigned long x, D *d) {}
24 Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.cc
25 ===================================================================
26 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
27 +++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.cc 2009-08-12 06:07:50.000000000 +0200
36 + virtual void funcA (unsigned long a, B *b);
37 + virtual void funcB (E *e);
38 + virtual void funcC (unsigned long x, bool y);
46 + std::cout << "foo" << std::endl;
51 +void F::funcA (unsigned long a, B *b) {}
52 +void F::funcB (E *e) {}
53 +void F::funcC (unsigned long x, bool y) {}
61 Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.exp
62 ===================================================================
63 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
64 +++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.exp 2009-08-12 06:58:28.000000000 +0200
66 +# This testcase is part of GDB, the GNU debugger.
68 +# Copyright 2005 Free Software Foundation, Inc.
70 +# This program is free software; you can redistribute it and/or modify
71 +# it under the terms of the GNU General Public License as published by
72 +# the Free Software Foundation; either version 2 of the License, or
73 +# (at your option) any later version.
75 +# This program is distributed in the hope that it will be useful,
76 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
77 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
78 +# GNU General Public License for more details.
80 +# You should have received a copy of the GNU General Public License
81 +# along with this program; if not, write to the Free Software
82 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
84 +# Check that GDB can properly print an inherited member variable
94 +set testfile "b146835"
95 +set srcfile ${testfile}.cc
96 +set srcfile2 ${testfile}b.cc
97 +set binfile ${objdir}/${subdir}/${testfile}
98 +if {[gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" "${binfile}" executable {debug c++}] != "" } {
104 +gdb_reinitialize_dir $srcdir/$subdir
108 +# Run to `main' where we begin our tests.
111 +if ![runto_main] then {
115 +gdb_test "break 'F::foo()'" ""
116 +gdb_continue_to_breakpoint "First line foo"
118 +# Verify that we can access the inherited member d
119 +gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible"
120 Index: gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.h
121 ===================================================================
122 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
123 +++ gdb-6.8.50.20090811/gdb/testsuite/gdb.cp/b146835.h 2009-08-12 06:07:50.000000000 +0200
130 + virtual void funcA (unsigned long a, class B *b) = 0;
131 + virtual void funcB (class E *e) = 0;
132 + virtual void funcC (unsigned long x, bool y) = 0;
134 + void funcD (class E *e, class D* d);
135 + virtual void funcE (E *e, D *d);
136 + virtual void funcF (unsigned long x, D *d);
140 +class C : public A {