Blame SOURCES/gdb-6.3-inheritancetest-20050726.patch

132741
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
132741
From: Jeff Johnston <jjohnstn@redhat.com>
132741
Date: Fri, 27 Oct 2017 21:07:50 +0200
132741
Subject: gdb-6.3-inheritancetest-20050726.patch
132741
132741
;; Verify printing of inherited members test
132741
;;=fedoratest
132741
132741
2005-07-26  Jeff Johnston  <jjohnstn@redhat.com>
132741
132741
	* gdb.cp/b146835.exp: New testcase.
132741
	* gdb.cp/b146835.cc: Ditto.
132741
	* gdb.cp/b146835b.cc: Ditto.
132741
	* gdb.cp/b146835.h: Ditto.
132741
132741
diff --git a/gdb/testsuite/gdb.cp/b146835.cc b/gdb/testsuite/gdb.cp/b146835.cc
132741
new file mode 100644
132741
--- /dev/null
132741
+++ b/gdb/testsuite/gdb.cp/b146835.cc
132741
@@ -0,0 +1,31 @@
132741
+#include "b146835.h"
132741
+#include <iostream>
132741
+
132741
+class F : public C {
132741
+
132741
+protected:
132741
+
132741
+   virtual void funcA (unsigned long a, B *b);
132741
+   virtual void funcB (E *e);
132741
+   virtual void funcC (unsigned long x, bool y);
132741
+
132741
+   char *s1, *s2;
132741
+   bool b1;
132741
+   int k;
132741
+
132741
+public:
132741
+   void foo() {
132741
+       std::cout << "foo" << std::endl;
132741
+   }
132741
+};
132741
+
132741
+
132741
+void F::funcA (unsigned long a, B *b) {}
132741
+void F::funcB (E *e) {}
132741
+void F::funcC (unsigned long x, bool y) {}
132741
+
132741
+int  main()
132741
+{
132741
+   F f;
132741
+   f.foo();
132741
+}
132741
diff --git a/gdb/testsuite/gdb.cp/b146835.exp b/gdb/testsuite/gdb.cp/b146835.exp
132741
new file mode 100644
132741
--- /dev/null
132741
+++ b/gdb/testsuite/gdb.cp/b146835.exp
132741
@@ -0,0 +1,47 @@
132741
+# This testcase is part of GDB, the GNU debugger.
132741
+
132741
+# Copyright 2005 Free Software Foundation, Inc.
132741
+
132741
+# This program is free software; you can redistribute it and/or modify
132741
+# it under the terms of the GNU General Public License as published by
132741
+# the Free Software Foundation; either version 2 of the License, or
132741
+# (at your option) any later version.
132741
+#
132741
+# This program is distributed in the hope that it will be useful,
132741
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
132741
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
132741
+# GNU General Public License for more details.
132741
+#
132741
+# You should have received a copy of the GNU General Public License
132741
+# along with this program; if not, write to the Free Software
132741
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
132741
+
132741
+# Check that GDB can properly print an inherited member variable
132741
+# (Bugzilla 146835)
132741
+
132741
+set testfile "b146835"
132741
+set srcfile ${testfile}.cc
132741
+set srcfile2 ${testfile}b.cc
132741
+set binfile [standard_output_file ${testfile}]
132741
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile2}" "${binfile}" executable {debug c++}] != "" } {
132741
+    return -1
132741
+}
132741
+
132741
+gdb_exit
132741
+gdb_start
132741
+gdb_reinitialize_dir $srcdir/$subdir
132741
+gdb_load ${binfile}
132741
+
132741
+#
132741
+# Run to `main' where we begin our tests.
132741
+#
132741
+
132741
+if ![runto_main] then {
132741
+    gdb_suppress_tests
132741
+}
132741
+
132741
+gdb_test "break 'F::foo()'" ""
132741
+gdb_continue_to_breakpoint "First line foo"
132741
+
132741
+# Verify that we can access the inherited member d
132741
+gdb_test "p d" " = \\(D \\*\\) *0x0" "Verify inherited member d accessible"
132741
diff --git a/gdb/testsuite/gdb.cp/b146835.h b/gdb/testsuite/gdb.cp/b146835.h
132741
new file mode 100644
132741
--- /dev/null
132741
+++ b/gdb/testsuite/gdb.cp/b146835.h
132741
@@ -0,0 +1,36 @@
132741
+
132741
+class A {
132741
+
132741
+protected:
132741
+
132741
+   virtual void funcA (unsigned long a, class B *b) = 0;
132741
+   virtual void funcB (class E *e) = 0;
132741
+   virtual void funcC (unsigned long x, bool y) = 0;
132741
+
132741
+   void funcD (class E *e, class D* d);
132741
+   virtual void funcE (E *e, D *d);
132741
+   virtual void funcF (unsigned long x, D *d);
132741
+};
132741
+
132741
+
132741
+class C : public A {
132741
+
132741
+protected:
132741
+
132741
+   int x;
132741
+   class K *k;
132741
+   class H *h;
132741
+
132741
+   D *d;
132741
+
132741
+   class W *w;
132741
+   class N *n;
132741
+   class L *l;
132741
+   unsigned long *r;
132741
+
132741
+public:
132741
+
132741
+   C();
132741
+   int z (char *s);
132741
+   virtual ~C();
132741
+};
132741
diff --git a/gdb/testsuite/gdb.cp/b146835b.cc b/gdb/testsuite/gdb.cp/b146835b.cc
132741
new file mode 100644
132741
--- /dev/null
132741
+++ b/gdb/testsuite/gdb.cp/b146835b.cc
132741
@@ -0,0 +1,11 @@
132741
+#include "b146835.h"
132741
+
132741
+C::C() { d = 0; x = 3; }
132741
+
132741
+int C::z (char *s) { return 0; }
132741
+
132741
+C::~C() {}
132741
+
132741
+void A::funcD (class E *e, class D *d) {}
132741
+void A::funcE (E *e, D *d) {}
132741
+void A::funcF (unsigned long x, D *d) {}