]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-6.3-inheritancetest-20050726.patch
- update to 6.8.91.20090930-1 from fedora
[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
7566401a
ER
8Index: 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
3a58abaf
AM
12@@ -0,0 +1,11 @@
13+#include "b146835.h"
14+
15+C::C() { d = 0; x = 3; }
16+
17+int C::z (char *s) { return 0; }
18+
19+C::~C() {}
20+
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) {}
7566401a
ER
24Index: 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
3a58abaf
AM
28@@ -0,0 +1,32 @@
29+#include "b146835.h"
30+#include <iostream>
31+
32+class F : public C {
33+
34+protected:
35+
36+ virtual void funcA (unsigned long a, B *b);
37+ virtual void funcB (E *e);
38+ virtual void funcC (unsigned long x, bool y);
39+
40+ char *s1, *s2;
41+ bool b1;
42+ int k;
43+
44+public:
45+ void foo() {
46+ std::cout << "foo" << std::endl;
47+ }
48+};
49+
50+
51+void F::funcA (unsigned long a, B *b) {}
52+void F::funcB (E *e) {}
53+void F::funcC (unsigned long x, bool y) {}
54+
55+int main()
56+{
57+ F f;
58+ f.foo();
59+}
60+
7566401a
ER
61Index: 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
65@@ -0,0 +1,54 @@
3a58abaf
AM
66+# This testcase is part of GDB, the GNU debugger.
67+
68+# Copyright 2005 Free Software Foundation, Inc.
69+
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.
74+#
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.
79+#
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.
83+
84+# Check that GDB can properly print an inherited member variable
85+# (Bugzilla 146835)
86+
87+if $tracelevel {
88+ strace $tracelevel
89+}
90+
91+set prms_id 0
92+set bug_id 0
93+
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++}] != "" } {
99+ return -1
100+}
101+
102+gdb_exit
103+gdb_start
104+gdb_reinitialize_dir $srcdir/$subdir
105+gdb_load ${binfile}
106+
107+#
108+# Run to `main' where we begin our tests.
109+#
110+
111+if ![runto_main] then {
112+ gdb_suppress_tests
113+}
114+
115+gdb_test "break 'F::foo()'" ""
116+gdb_continue_to_breakpoint "First line foo"
117+
118+# Verify that we can access the inherited member d
7566401a
ER
119+gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible"
120Index: 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
3a58abaf
AM
124@@ -0,0 +1,36 @@
125+
126+class A {
127+
128+protected:
129+
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;
133+
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);
137+};
138+
139+
140+class C : public A {
141+
142+protected:
143+
144+ int x;
145+ class K *k;
146+ class H *h;
147+
148+ D *d;
149+
150+ class W *w;
151+ class N *n;
152+ class L *l;
153+ unsigned long *r;
154+
155+public:
156+
157+ C();
158+ int z (char *s);
159+ virtual ~C();
160+};
This page took 0.044388 seconds and 4 git commands to generate.