2017-12-10 22:00:49 +00:00
|
|
|
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
2017-12-04 19:24:00 +00:00
|
|
|
From: Jeff Johnston <jjohnstn@redhat.com>
|
|
|
|
Date: Fri, 27 Oct 2017 21:07:50 +0200
|
|
|
|
Subject: gdb-6.3-inheritancetest-20050726.patch
|
|
|
|
|
|
|
|
FileName: gdb-6.3-inheritancetest-20050726.patch
|
|
|
|
|
2017-12-08 04:31:26 +00:00
|
|
|
;; Verify printing of inherited members test
|
|
|
|
;;=fedoratest
|
|
|
|
|
2005-07-26 21:29:05 +00:00
|
|
|
2005-07-26 Jeff Johnston <jjohnstn@redhat.com>
|
|
|
|
|
|
|
|
* gdb.cp/b146835.exp: New testcase.
|
|
|
|
* gdb.cp/b146835.cc: Ditto.
|
|
|
|
* gdb.cp/b146835b.cc: Ditto.
|
|
|
|
* gdb.cp/b146835.h: Ditto.
|
2017-12-08 04:31:26 +00:00
|
|
|
---
|
|
|
|
gdb/testsuite/gdb.cp/b146835.cc | 32 +++++++++++++++++++++++++++
|
|
|
|
gdb/testsuite/gdb.cp/b146835.exp | 47 ++++++++++++++++++++++++++++++++++++++++
|
|
|
|
gdb/testsuite/gdb.cp/b146835.h | 36 ++++++++++++++++++++++++++++++
|
|
|
|
gdb/testsuite/gdb.cp/b146835b.cc | 11 ++++++++++
|
|
|
|
4 files changed, 126 insertions(+)
|
|
|
|
create mode 100644 gdb/testsuite/gdb.cp/b146835.cc
|
|
|
|
create mode 100644 gdb/testsuite/gdb.cp/b146835.exp
|
|
|
|
create mode 100644 gdb/testsuite/gdb.cp/b146835.h
|
|
|
|
create mode 100644 gdb/testsuite/gdb.cp/b146835b.cc
|
2005-07-26 21:29:05 +00:00
|
|
|
|
2017-12-08 04:31:26 +00:00
|
|
|
diff --git a/gdb/testsuite/gdb.cp/b146835.cc b/gdb/testsuite/gdb.cp/b146835.cc
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000..4161d523f5
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/gdb/testsuite/gdb.cp/b146835.cc
|
2005-07-26 21:29:05 +00:00
|
|
|
@@ -0,0 +1,32 @@
|
|
|
|
+#include "b146835.h"
|
|
|
|
+#include <iostream>
|
|
|
|
+
|
|
|
|
+class F : public C {
|
|
|
|
+
|
|
|
|
+protected:
|
|
|
|
+
|
|
|
|
+ virtual void funcA (unsigned long a, B *b);
|
|
|
|
+ virtual void funcB (E *e);
|
|
|
|
+ virtual void funcC (unsigned long x, bool y);
|
|
|
|
+
|
|
|
|
+ char *s1, *s2;
|
|
|
|
+ bool b1;
|
|
|
|
+ int k;
|
|
|
|
+
|
|
|
|
+public:
|
|
|
|
+ void foo() {
|
|
|
|
+ std::cout << "foo" << std::endl;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+void F::funcA (unsigned long a, B *b) {}
|
|
|
|
+void F::funcB (E *e) {}
|
|
|
|
+void F::funcC (unsigned long x, bool y) {}
|
|
|
|
+
|
|
|
|
+int main()
|
|
|
|
+{
|
|
|
|
+ F f;
|
|
|
|
+ f.foo();
|
|
|
|
+}
|
|
|
|
+
|
2017-12-08 04:31:26 +00:00
|
|
|
diff --git a/gdb/testsuite/gdb.cp/b146835.exp b/gdb/testsuite/gdb.cp/b146835.exp
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000..d03815bcff
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/gdb/testsuite/gdb.cp/b146835.exp
|
2010-07-21 21:30:20 +00:00
|
|
|
@@ -0,0 +1,47 @@
|
2005-07-26 21:29:05 +00:00
|
|
|
+# This testcase is part of GDB, the GNU debugger.
|
|
|
|
+
|
|
|
|
+# Copyright 2005 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 2 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, write to the Free Software
|
|
|
|
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
+
|
|
|
|
+# Check that GDB can properly print an inherited member variable
|
|
|
|
+# (Bugzilla 146835)
|
|
|
|
+
|
|
|
|
+set testfile "b146835"
|
|
|
|
+set srcfile ${testfile}.cc
|
|
|
|
+set srcfile2 ${testfile}b.cc
|
2016-02-16 09:54:56 +00:00
|
|
|
+set binfile [standard_output_file ${testfile}]
|
2005-07-26 21:29:05 +00:00
|
|
|
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" "${binfile}" executable {debug c++}] != "" } {
|
|
|
|
+ return -1
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+gdb_exit
|
|
|
|
+gdb_start
|
|
|
|
+gdb_reinitialize_dir $srcdir/$subdir
|
|
|
|
+gdb_load ${binfile}
|
|
|
|
+
|
|
|
|
+#
|
|
|
|
+# Run to `main' where we begin our tests.
|
|
|
|
+#
|
|
|
|
+
|
|
|
|
+if ![runto_main] then {
|
|
|
|
+ gdb_suppress_tests
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+gdb_test "break 'F::foo()'" ""
|
|
|
|
+gdb_continue_to_breakpoint "First line foo"
|
|
|
|
+
|
|
|
|
+# Verify that we can access the inherited member d
|
2009-08-12 14:36:09 +00:00
|
|
|
+gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible"
|
2017-12-08 04:31:26 +00:00
|
|
|
diff --git a/gdb/testsuite/gdb.cp/b146835.h b/gdb/testsuite/gdb.cp/b146835.h
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000..48df7a2935
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/gdb/testsuite/gdb.cp/b146835.h
|
2005-07-26 21:29:05 +00:00
|
|
|
@@ -0,0 +1,36 @@
|
|
|
|
+
|
|
|
|
+class A {
|
|
|
|
+
|
|
|
|
+protected:
|
|
|
|
+
|
|
|
|
+ virtual void funcA (unsigned long a, class B *b) = 0;
|
|
|
|
+ virtual void funcB (class E *e) = 0;
|
|
|
|
+ virtual void funcC (unsigned long x, bool y) = 0;
|
|
|
|
+
|
|
|
|
+ void funcD (class E *e, class D* d);
|
|
|
|
+ virtual void funcE (E *e, D *d);
|
|
|
|
+ virtual void funcF (unsigned long x, D *d);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+class C : public A {
|
|
|
|
+
|
|
|
|
+protected:
|
|
|
|
+
|
|
|
|
+ int x;
|
|
|
|
+ class K *k;
|
|
|
|
+ class H *h;
|
|
|
|
+
|
|
|
|
+ D *d;
|
|
|
|
+
|
|
|
|
+ class W *w;
|
|
|
|
+ class N *n;
|
|
|
|
+ class L *l;
|
|
|
|
+ unsigned long *r;
|
|
|
|
+
|
|
|
|
+public:
|
|
|
|
+
|
|
|
|
+ C();
|
|
|
|
+ int z (char *s);
|
|
|
|
+ virtual ~C();
|
|
|
|
+};
|
2017-12-08 04:31:26 +00:00
|
|
|
diff --git a/gdb/testsuite/gdb.cp/b146835b.cc b/gdb/testsuite/gdb.cp/b146835b.cc
|
|
|
|
new file mode 100644
|
|
|
|
index 0000000000..1853c1fa38
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/gdb/testsuite/gdb.cp/b146835b.cc
|
|
|
|
@@ -0,0 +1,11 @@
|
|
|
|
+#include "b146835.h"
|
|
|
|
+
|
|
|
|
+C::C() { d = 0; x = 3; }
|
|
|
|
+
|
|
|
|
+int C::z (char *s) { return 0; }
|
|
|
|
+
|
|
|
|
+C::~C() {}
|
|
|
|
+
|
|
|
|
+void A::funcD (class E *e, class D *d) {}
|
|
|
|
+void A::funcE (E *e, D *d) {}
|
|
|
|
+void A::funcF (unsigned long x, D *d) {}
|
|
|
|
--
|
|
|
|
2.14.3
|
|
|
|
|