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

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