]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-6.3-inheritancetest-20050726.patch
- obsolete file
[packages/gdb.git] / gdb-6.3-inheritancetest-20050726.patch
CommitLineData
3a58abaf
AM
12005-07-26 Jeff Johnston <jjohnstn@redhat.com>
2
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.
7
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
10@@ -0,0 +1,11 @@
11+#include "b146835.h"
12+
13+C::C() { d = 0; x = 3; }
14+
15+int C::z (char *s) { return 0; }
16+
17+C::~C() {}
18+
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
24@@ -0,0 +1,32 @@
25+#include "b146835.h"
26+#include <iostream>
27+
28+class F : public C {
29+
30+protected:
31+
32+ virtual void funcA (unsigned long a, B *b);
33+ virtual void funcB (E *e);
34+ virtual void funcC (unsigned long x, bool y);
35+
36+ char *s1, *s2;
37+ bool b1;
38+ int k;
39+
40+public:
41+ void foo() {
42+ std::cout << "foo" << std::endl;
43+ }
44+};
45+
46+
47+void F::funcA (unsigned long a, B *b) {}
48+void F::funcB (E *e) {}
49+void F::funcC (unsigned long x, bool y) {}
50+
51+int main()
52+{
53+ F f;
54+ f.foo();
55+}
56+
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
59@@ -0,0 +1,55 @@
60+# This testcase is part of GDB, the GNU debugger.
61+
62+# Copyright 2005 Free Software Foundation, Inc.
63+
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.
68+#
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.
73+#
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.
77+
78+# Check that GDB can properly print an inherited member variable
79+# (Bugzilla 146835)
80+
81+if $tracelevel {
82+ strace $tracelevel
83+}
84+
85+set prms_id 0
86+set bug_id 0
87+
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++}] != "" } {
93+ return -1
94+}
95+
96+gdb_exit
97+gdb_start
98+gdb_reinitialize_dir $srcdir/$subdir
99+gdb_load ${binfile}
100+
101+#
102+# Run to `main' where we begin our tests.
103+#
104+
105+if ![runto_main] then {
106+ gdb_suppress_tests
107+}
108+
109+gdb_test "break 'F::foo()'" ""
110+gdb_continue_to_breakpoint "First line foo"
111+
112+# Verify that we can access the inherited member d
113+gdb_test "p d" ".*(struct D \*.).*0x0" "Verify inherited member d accessible"
114+
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
117@@ -0,0 +1,36 @@
118+
119+class A {
120+
121+protected:
122+
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;
126+
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);
130+};
131+
132+
133+class C : public A {
134+
135+protected:
136+
137+ int x;
138+ class K *k;
139+ class H *h;
140+
141+ D *d;
142+
143+ class W *w;
144+ class N *n;
145+ class L *l;
146+ unsigned long *r;
147+
148+public:
149+
150+ C();
151+ int z (char *s);
152+ virtual ~C();
153+};
This page took 0.077022 seconds and 4 git commands to generate.