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 --- gdb-6.3/gdb/testsuite/gdb.cp/b146835b.cc.fix3 2005-07-26 16:47:12.000000000 -0400
9 +++ gdb-6.3/gdb/testsuite/gdb.cp/b146835b.cc 2005-07-26 16:53:31.000000000 -0400
13 +C::C() { d = 0; x = 3; }
15 +int C::z (char *s) { return 0; }
19 +void A::funcD (class E *e, class D *d) {}
20 +void A::funcE (E *e, D *d) {}
21 +void A::funcF (unsigned long x, D *d) {}
22 --- gdb-6.3/gdb/testsuite/gdb.cp/b146835.cc.fix3 2005-07-26 16:47:20.000000000 -0400
23 +++ gdb-6.3/gdb/testsuite/gdb.cp/b146835.cc 2005-07-26 16:46:50.000000000 -0400
32 + virtual void funcA (unsigned long a, B *b);
33 + virtual void funcB (E *e);
34 + virtual void funcC (unsigned long x, bool y);
42 + std::cout << "foo" << std::endl;
47 +void F::funcA (unsigned long a, B *b) {}
48 +void F::funcB (E *e) {}
49 +void F::funcC (unsigned long x, bool y) {}
57 --- gdb-6.3/gdb/testsuite/gdb.cp/b146835.exp.fix3 2005-07-26 16:47:26.000000000 -0400
58 +++ gdb-6.3/gdb/testsuite/gdb.cp/b146835.exp 2005-07-26 16:46:50.000000000 -0400
60 +# This testcase is part of GDB, the GNU debugger.
62 +# Copyright 2005 Free Software Foundation, Inc.
64 +# This program is free software; you can redistribute it and/or modify
65 +# it under the terms of the GNU General Public License as published by
66 +# the Free Software Foundation; either version 2 of the License, or
67 +# (at your option) any later version.
69 +# This program is distributed in the hope that it will be useful,
70 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
71 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
72 +# GNU General Public License for more details.
74 +# You should have received a copy of the GNU General Public License
75 +# along with this program; if not, write to the Free Software
76 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
78 +# Check that GDB can properly print an inherited member variable
88 +set testfile "b146835"
89 +set srcfile ${testfile}.cc
90 +set srcfile2 ${testfile}b.cc
91 +set binfile ${objdir}/${subdir}/${testfile}
92 +if {[gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" "${binfile}" executable {debug c++}] != "" } {
98 +gdb_reinitialize_dir $srcdir/$subdir
102 +# Run to `main' where we begin our tests.
105 +if ![runto_main] then {
109 +gdb_test "break 'F::foo()'" ""
110 +gdb_continue_to_breakpoint "First line foo"
112 +# Verify that we can access the inherited member d
113 +gdb_test "p d" ".*(struct D \*.).*0x0" "Verify inherited member d accessible"
115 --- gdb-6.3/gdb/testsuite/gdb.cp/b146835.h.fix3 2005-07-26 16:47:36.000000000 -0400
116 +++ gdb-6.3/gdb/testsuite/gdb.cp/b146835.h 2005-07-26 16:53:18.000000000 -0400
123 + virtual void funcA (unsigned long a, class B *b) = 0;
124 + virtual void funcB (class E *e) = 0;
125 + virtual void funcC (unsigned long x, bool y) = 0;
127 + void funcD (class E *e, class D* d);
128 + virtual void funcE (E *e, D *d);
129 + virtual void funcF (unsigned long x, D *d);
133 +class C : public A {