This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch/commit/testsuite/cp] make *.exp compatible with previous version


This patch changes classes.exp, derivation.exp, overload.exp, and
virtfunc.exp so that gdb.sum has exactly the same results as it used to
before my orgy of rewriting.

I tested this on native i686-pc-linux-gnu with:

  gcc 2.95.3, gcc 3.3.2, gcc HEAD
  dwarf-2, stabs+
  TCL 8.4.5 + expect 5.39 + dejagnu 1.4.3
  TCL sourceware + expect sourceware + dejagnu sourceware

I am committing this now.

After a week goes by, I will come back with incremental patches to
fix the actual problems, including the problem with the new gcc ABI.

(I can already hear Andrew saying: "get a branch!")

Michael C

2004-01-01  Michael Chastain  <mec.gnu@mindspring.com>

	* gdb.cp/classes.exp: Generate identical results as old version.
	* gdb.cp/derivation.exp: Likewise.
	* gdb.cp/overload.exp: Likewise.
	* gdb.cp/virtfunc.exp: Likewise.

Index: classes.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/classes.exp,v
retrieving revision 1.3
diff -c -3 -p -r1.3 classes.exp
*** classes.exp	31 Dec 2003 20:59:11 -0000	1.3
--- classes.exp	2 Jan 2004 04:16:39 -0000
***************
*** 1,5 ****
  # Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
! # 2003 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
--- 1,5 ----
  # Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
! # 2003, 2004 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
*************** proc test_ptype_class_objects {} {
*** 264,270 ****
  	    # gcc 2.95.3 -gdwarf-2
  	    # gcc 3.3.2 -gdwarf-2
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gdwarf-2
! 	    pass "ptype class B"
  	}
  	-re "type = class B : public A \{${ws}public:${ws}int b;${ws}int x;${ws}B ?& ?operator ?=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
--- 264,271 ----
  	    # gcc 2.95.3 -gdwarf-2
  	    # gcc 3.3.2 -gdwarf-2
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gdwarf-2
! 	    # TODO: this is not obsolescent!
! 	    pass "ptype class B (obsolescent gcc or gdb)"
  	}
  	-re "type = class B : public A \{${ws}public:${ws}int b;${ws}int x;${ws}B ?& ?operator ?=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
*************** proc test_ptype_class_objects {} {
*** 281,287 ****
  	    # gcc 2.95.3 -gdwarf-2
  	    # gcc 3.3.2 -gdwarf-2
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gdwarf-2
! 	    pass "ptype class C"
  	}
  	-re "type = class C : public A \{${ws}public:${ws}int c;${ws}int x;${ws}C ?& ?operator ?=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
--- 282,289 ----
  	    # gcc 2.95.3 -gdwarf-2
  	    # gcc 3.3.2 -gdwarf-2
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gdwarf-2
! 	    # TODO: this is not obsolescent!
! 	    pass "ptype class C (obsolescent gcc or gdb)"
  	}
  	-re "type = class C : public A \{${ws}public:${ws}int c;${ws}int x;${ws}C ?& ?operator ?=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
*************** proc test_ptype_class_objects {} {
*** 298,304 ****
  	    # gcc 2.95.3 -gdwarf-2
  	    # gcc 3.3.2 -gdwarf-2
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gdwarf-2
! 	    pass "ptype class D"
  	}
  	-re "type = class D : public B, public C \{${ws}public:${ws}int d;${ws}int x;${ws}D ?& ?operator ?=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
--- 300,307 ----
  	    # gcc 2.95.3 -gdwarf-2
  	    # gcc 3.3.2 -gdwarf-2
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gdwarf-2
! 	    # TODO: this is not obsolescent!
! 	    pass "ptype class D (obsolescent gcc or gdb)"
  	}
  	-re "type = class D : public B, public C \{${ws}public:${ws}int d;${ws}int x;${ws}D ?& ?operator ?=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
*************** proc test_ptype_class_objects {} {
*** 344,350 ****
  	}
  	-re "type = class Static \{${ws}public:${ws}static void ii\\(int, int\\);${ws}Static ?& ?operator ?=\\(Static const ?&\\);${ws}Static\\(Static const ?&\\);${ws}Static\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gstabs+
! 	    pass "ptype class Static"
  	}
      }
  
--- 347,354 ----
  	}
  	-re "type = class Static \{${ws}public:${ws}static void ii\\(int, int\\);${ws}Static ?& ?operator ?=\\(Static const ?&\\);${ws}Static\\(Static const ?&\\);${ws}Static\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gstabs+
! 	    # TODO: this is okay.  It is just ABI 2.
! 	    fail "ptype class Static"
  	}
      }
  
*************** proc test_ptype_class_objects {} {
*** 365,378 ****
  	}
      }
  
!     # Accept the virtual base pointer if gdb wants to print it.
!     # Those cases will go away when gcc 2 dies.
      # With gcc 3, gdb does not print the virtual base pointer.
  
      gdb_test_multiple "ptype class vB" "ptype class vB" {
  	-re "type = class vB : public virtual vA \{${ws}private:${ws}vA ?\\* ?_vb.2vA;${ws}public:${ws}int vb;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gdwarf-2
! 	    pass "ptype class vB"
  	}
  	-re "type = class vB : public virtual vA \{${ws}public:${ws}int vb;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gdwarf-2
--- 369,383 ----
  	}
      }
  
!     # With gcc 2, gdb prints the virtual base pointer.
      # With gcc 3, gdb does not print the virtual base pointer.
+     # drow considers it a gdb bug if gdb prints the vbptr.
  
      gdb_test_multiple "ptype class vB" "ptype class vB" {
  	-re "type = class vB : public virtual vA \{${ws}private:${ws}vA ?\\* ?_vb.2vA;${ws}public:${ws}int vb;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gdwarf-2
! 	    # TODO: kfail this
! 	    fail "ptype class vB"
  	}
  	-re "type = class vB : public virtual vA \{${ws}public:${ws}int vb;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gdwarf-2
*************** proc test_ptype_class_objects {} {
*** 382,388 ****
  	-re "type = class vB : public virtual vA \{${ws}private:${ws}vA ?\\* ?_vb.vA;${ws}public:${ws}int vb;${ws}int vx;${ws}vB ?& ?operator ?=\\(vB const ?&\\);${ws}vB\\(int, ?vB const ?&\\);${ws}vB\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
  	    # See the hidden "in-charge" ctor parameter!
! 	    pass "ptype class vB"
  	}
  	-re "type = class vB : public virtual vA \{${ws}public:${ws}int vb;${ws}int vx;${ws}vB ?& ?operator ?=\\(vB const ?&\\);${ws}vB\\(vB const ?&\\);${ws}vB\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gstabs+
--- 387,395 ----
  	-re "type = class vB : public virtual vA \{${ws}private:${ws}vA ?\\* ?_vb.vA;${ws}public:${ws}int vb;${ws}int vx;${ws}vB ?& ?operator ?=\\(vB const ?&\\);${ws}vB\\(int, ?vB const ?&\\);${ws}vB\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
  	    # See the hidden "in-charge" ctor parameter!
! 	    # TODO: kfail this
! 	    setup_xfail "*-*-*"
! 	    fail "ptype class vB (FIXME: non-portable virtual table constructs)"
  	}
  	-re "type = class vB : public virtual vA \{${ws}public:${ws}int vb;${ws}int vx;${ws}vB ?& ?operator ?=\\(vB const ?&\\);${ws}vB\\(vB const ?&\\);${ws}vB\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gstabs+
*************** proc test_ptype_class_objects {} {
*** 396,402 ****
      gdb_test_multiple "ptype class vC" "ptype class vC" {
  	-re "type = class vC : public virtual vA \{${ws}private:${ws}vA ?\\* ?_vb.2vA;${ws}public:${ws}int vc;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gdwarf-2
! 	    pass "ptype class vC"
  	}
  	-re "type = class vC : public virtual vA \{${ws}public:${ws}int vc;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gdwarf-2
--- 403,410 ----
      gdb_test_multiple "ptype class vC" "ptype class vC" {
  	-re "type = class vC : public virtual vA \{${ws}private:${ws}vA ?\\* ?_vb.2vA;${ws}public:${ws}int vc;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gdwarf-2
! 	    # TODO: kfail
! 	    fail "ptype class vC"
  	}
  	-re "type = class vC : public virtual vA \{${ws}public:${ws}int vc;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gdwarf-2
*************** proc test_ptype_class_objects {} {
*** 406,412 ****
  	-re "type = class vC : public virtual vA \{${ws}private:${ws}vA ?\\* ?_vb.vA;${ws}public:${ws}int vc;${ws}int vx;${ws}vC ?& ?operator ?=\\(vC const ?&\\);${ws}vC\\(int, ?vC const ?&\\);${ws}vC\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
  	    # See the hidden "in-charge" ctor parameter!
! 	    pass "ptype class vC"
  	}
  	-re "type = class vC : public virtual vA \{${ws}public:${ws}int vc;${ws}int vx;${ws}vC ?& ?operator ?=\\(vC const ?&\\);${ws}vC\\(vC const ?&\\);${ws}vC\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gstabs+
--- 414,422 ----
  	-re "type = class vC : public virtual vA \{${ws}private:${ws}vA ?\\* ?_vb.vA;${ws}public:${ws}int vc;${ws}int vx;${ws}vC ?& ?operator ?=\\(vC const ?&\\);${ws}vC\\(int, ?vC const ?&\\);${ws}vC\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
  	    # See the hidden "in-charge" ctor parameter!
! 	    # TODO: kfail
! 	    setup_xfail "*-*-*"
! 	    fail "ptype class vC (FIXME: non-portable virtual table constructs)"
  	}
  	-re "type = class vC : public virtual vA \{${ws}public:${ws}int vc;${ws}int vx;${ws}vC ?& ?operator ?=\\(vC const ?&\\);${ws}vC\\(vC const ?&\\);${ws}vC\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gstabs+
*************** proc test_ptype_class_objects {} {
*** 420,426 ****
      gdb_test_multiple "ptype class vD" "ptype class vD" {
  	-re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC ?\\* ?_vb.2vC;${ws}vB ?\\* ?_vb.2vB;${ws}public:${ws}int vd;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gdwarf-2
! 	    pass "ptype class vD"
  	}
  	-re "type = class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gdwarf-2
--- 430,437 ----
      gdb_test_multiple "ptype class vD" "ptype class vD" {
  	-re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC ?\\* ?_vb.2vC;${ws}vB ?\\* ?_vb.2vB;${ws}public:${ws}int vd;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gdwarf-2
! 	    # TODO: kfail
! 	    fail "ptype class vD"
  	}
  	-re "type = class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gdwarf-2
*************** proc test_ptype_class_objects {} {
*** 430,436 ****
  	-re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC ?\\* ?_vb.vC;${ws}vB ?\\* ?_vb.vB;${ws}public:${ws}int vd;${ws}int vx;${ws}vD ?& ?operator ?=\\(vD const ?&\\);${ws}vD\\(int, ?vD const ?&\\);${ws}vD\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
  	    # See the hidden "in-charge" ctor parameter!
! 	    pass "ptype class vD"
  	}
  	-re "type = class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;${ws}vD ?& ?operator ?=\\(vD const ?&\\);${ws}vD\\(vD const ?&\\);${ws}vD\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gstabs+
--- 441,449 ----
  	-re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC ?\\* ?_vb.vC;${ws}vB ?\\* ?_vb.vB;${ws}public:${ws}int vd;${ws}int vx;${ws}vD ?& ?operator ?=\\(vD const ?&\\);${ws}vD\\(int, ?vD const ?&\\);${ws}vD\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
  	    # See the hidden "in-charge" ctor parameter!
! 	    # TODO: kfail
! 	    setup_xfail "*-*-*"
! 	    fail "ptype class vD (FIXME: non-portable virtual table constructs)"
  	}
  	-re "type = class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;${ws}vD ?& ?operator ?=\\(vD const ?&\\);${ws}vD\\(vD const ?&\\);${ws}vD\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gstabs+
*************** proc test_ptype_class_objects {} {
*** 444,450 ****
      gdb_test_multiple "ptype class vE" "ptype class vE" {
  	-re "type = class vE : public virtual vD \{${ws}private:${ws}vD ?\\* ?_vb.2vD;${ws}public:${ws}int ve;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gdwarf-2
! 	    pass "ptype class vE"
  	}
  	-re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gdwarf-2
--- 457,464 ----
      gdb_test_multiple "ptype class vE" "ptype class vE" {
  	-re "type = class vE : public virtual vD \{${ws}private:${ws}vD ?\\* ?_vb.2vD;${ws}public:${ws}int ve;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gdwarf-2
! 	    # TODO: kfail
! 	    fail "ptype class vE"
  	}
  	-re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gdwarf-2
*************** proc test_ptype_class_objects {} {
*** 454,460 ****
  	-re "type = class vE : public virtual vD \{${ws}private:${ws}vD ?\\* ?_vb.vD;${ws}public:${ws}int ve;${ws}int vx;${ws}vE ?& ?operator ?=\\(vE const ?&\\);${ws}vE\\(int, ?vE const ?&\\);${ws}vE\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
  	    # See the hidden "in-charge" ctor parameter!
! 	    pass "ptype class vE"
  	}
  	-re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;${ws}vE ?& ?operator ?=\\(vE const ?&\\);${ws}vE\\(vE const ?&\\);${ws}vE\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gstabs+
--- 468,476 ----
  	-re "type = class vE : public virtual vD \{${ws}private:${ws}vD ?\\* ?_vb.vD;${ws}public:${ws}int ve;${ws}int vx;${ws}vE ?& ?operator ?=\\(vE const ?&\\);${ws}vE\\(int, ?vE const ?&\\);${ws}vE\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
  	    # See the hidden "in-charge" ctor parameter!
! 	    # TODO: kfail
! 	    setup_xfail "*-*-*"
! 	    fail "ptype class vE (FIXME: non-portable virtual table constructs)"
  	}
  	-re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;${ws}vE ?& ?operator ?=\\(vE const ?&\\);${ws}vE\\(vE const ?&\\);${ws}vE\\((void|)\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gstabs+
*************** proc test_ptype_class_objects {} {
*** 479,485 ****
  	}
  	-re "type = class Base1 \{${ws}public:${ws}int x;${ws}Base1\\(int\\);${ws}Base1 ?& ?operator ?=\\(Base1 const ?&\\);${ws}Base1\\(Base1 const ?&\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gstabs+
! 	    pass "ptype class Base1"
  	}
      }
  
--- 495,502 ----
  	}
  	-re "type = class Base1 \{${ws}public:${ws}int x;${ws}Base1\\(int\\);${ws}Base1 ?& ?operator ?=\\(Base1 const ?&\\);${ws}Base1\\(Base1 const ?&\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gstabs+
! 	    # TODO: this is not obsolescent!
! 	    pass "ptype class Base1 (obsolescent gcc or gdb)"
  	}
      }
  
*************** proc test_ptype_class_objects {} {
*** 494,501 ****
  	}
  	-re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;${ws}Foo ?& ?operator ?=\\(Foo const ?&\\);${ws}Foo\\(Foo const ?&\\);${ws}Foo\\(int, int\\);${ws}int operator ?!\\((void|)\\);${ws}int operator int\\((void|)\\);${ws}int times\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
! 	    # "int operator int()" is a bug
! 	    kfail "gdb/1497" "ptype class Foo"
  	}
  	-re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;${ws}Foo ?& ?operator ?=\\(Foo const ?&\\);${ws}Foo\\(Foo const ?&\\);${ws}Foo\\(int, int\\);${ws}int operator ?!\\((void|)\\);${ws}operator int\\((void|)\\);${ws}int times\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gstabs+
--- 511,520 ----
  	}
  	-re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;${ws}Foo ?& ?operator ?=\\(Foo const ?&\\);${ws}Foo\\(Foo const ?&\\);${ws}Foo\\(int, int\\);${ws}int operator ?!\\((void|)\\);${ws}int operator int\\((void|)\\);${ws}int times\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
! 	    # TODO: "int operator int()" is a bug
! 	    # TODO: this is not obsolescent!
! 	    # kfail "gdb/1497" "ptype class Foo"
! 	    pass "ptype class Foo (obsolescent gcc or gdb)"
  	}
  	-re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;${ws}Foo ?& ?operator ?=\\(Foo const ?&\\);${ws}Foo\\(Foo const ?&\\);${ws}Foo\\(int, int\\);${ws}int operator ?!\\((void|)\\);${ws}operator int\\((void|)\\);${ws}int times\\(int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 3.3.2 -gstabs+
*************** proc test_ptype_class_objects {} {
*** 503,509 ****
  	}
  	-re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;${ws}Foo\\(int, int\\);${ws}int operator ?!\\((void|)\\);${ws}operator int\\((void|)\\);${ws}int times\\(int\\);${ws}Foo ?& ?operator ?=\\(Foo const ?&\\);${ws}Foo\\(Foo const ?&\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gstabs+
! 	    pass "ptype class Foo"
  	}
      }
  
--- 522,529 ----
  	}
  	-re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;${ws}Foo\\(int, int\\);${ws}int operator ?!\\((void|)\\);${ws}operator int\\((void|)\\);${ws}int times\\(int\\);${ws}Foo ?& ?operator ?=\\(Foo const ?&\\);${ws}Foo\\(Foo const ?&\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gstabs+
! 	    # TODO: this is okay, just the new ABI
! 	    fail "ptype class Foo"
  	}
      }
  
*************** proc test_ptype_class_objects {} {
*** 514,520 ****
  	    # gcc 2.95.3 -gdwarf-2
  	    # gcc 3.3.2 -gdwarf-2
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gdwarf-2
! 	    pass "ptype class Bar"
  	}
  	-re "type = class Bar : public Base1, public Foo \{${ws}public:${ws}int z;${ws}Bar ?& ?operator ?=\\(Bar const ?&\\);${ws}Bar\\(Bar const ?&\\);${ws}Bar\\(int, int, int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
--- 534,541 ----
  	    # gcc 2.95.3 -gdwarf-2
  	    # gcc 3.3.2 -gdwarf-2
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gdwarf-2
! 	    # TODO: this is not obsolescent!
! 	    pass "ptype class Bar (obsolescent gcc or gdb)"
  	}
  	-re "type = class Bar : public Base1, public Foo \{${ws}public:${ws}int z;${ws}Bar ?& ?operator ?=\\(Bar const ?&\\);${ws}Bar\\(Bar const ?&\\);${ws}Bar\\(int, int, int\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc 2.95.3 -gstabs+
*************** proc test_ptype_class_objects {} {
*** 523,529 ****
  	}
  	-re "type = class Bar : public Base1, public Foo \{${ws}public:${ws}int z;${ws}Bar\\(int, int, int\\);${ws}Bar ?& ?operator ?=\\(Bar const ?&\\);${ws}Bar\\(Bar const ?&\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gstabs+
! 	    pass "ptype class Bar"
  	}
      }
  }
--- 544,551 ----
  	}
  	-re "type = class Bar : public Base1, public Foo \{${ws}public:${ws}int z;${ws}Bar\\(int, int, int\\);${ws}Bar ?& ?operator ?=\\(Bar const ?&\\);${ws}Bar\\(Bar const ?&\\);$nl\}$nl$gdb_prompt $" {
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gstabs+
! 	    # TODO: this is not obsolescent!
! 	    pass "ptype class Bar (obsolescent gcc or gdb)"
  	}
      }
  }
*************** proc test_enums {} {
*** 693,699 ****
  	    #
  	    # gcc 3.3.2 -gstabs+
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gstabs+
! 	    pass "ptype obj_with_enum"
  	}
      }
  
--- 715,721 ----
  	    #
  	    # gcc 3.3.2 -gstabs+
  	    # gcc HEAD 2003-12-28 21:08:30 UTC -gstabs+
! 	    fail "ptype obj_with_enum"
  	}
      }
  
*************** proc test_pointers_to_class_members {} {
*** 736,741 ****
--- 758,770 ----
      gdb_test "print &Foo::x" "\\$\[0-9\]+ = \\(int ?\\( ?Foo::\\* ?\\) ?\\) ?&Foo::x"
      gdb_test "print (int)&Foo::x" "\\$\[0-9\]+ = 0"
      gdb_test "print (int)&Bar::y == 2*sizeof(int)" "\\$\[0-9\]+ = true"
+ 
+     # TODO: this is a bogus test.  It's looking at a variable that
+     # has not even been declared yet, so it's accessing random junk
+     # on the stack and comparing that it's NOT equal to a specific
+     # value.  It's been like this since gdb 4.10 in 1993!
+     # -- chastain 2004-01-01
+     gdb_test "print (int)pmi == sizeof(int)" ".* = false"
  }
  
  # Test static members.
*************** proc test_static_members {} {
*** 745,751 ****
      global hex
  
      gdb_test "print Foo::st" "\\$\[0-9\]+ = 100"
!     gdb_test "set foo.st = 200" ""
      gdb_test "print bar.st" "\\$\[0-9\]+ = 200"
      gdb_test "print &foo.st" "\\$\[0-9\]+ = \\(int ?\\*\\) $hex"
      gdb_test "print &Bar::st" "\\$\[0-9\]+ = \\(int ?\\*\\) $hex"
--- 774,780 ----
      global hex
  
      gdb_test "print Foo::st" "\\$\[0-9\]+ = 100"
!     gdb_test "set foo.st = 200" "" ""
      gdb_test "print bar.st" "\\$\[0-9\]+ = 200"
      gdb_test "print &foo.st" "\\$\[0-9\]+ = \\(int ?\\*\\) $hex"
      gdb_test "print &Bar::st" "\\$\[0-9\]+ = \\(int ?\\*\\) $hex"
*************** proc do_tests {} {
*** 796,804 ****
  	return
      }
  
-     test_pointers_to_class_members
-     test_static_members
- 
      gdb_breakpoint inheritance2
      gdb_test "continue" ".*Breakpoint .* inheritance2.*" ""
  
--- 825,830 ----
*************** proc do_tests {} {
*** 809,818 ****
      test_method_param_class
  
      gdb_breakpoint enums2
!     gdb_test "continue" ".*Breakpoint .* enums2.*" ""
      gdb_test "finish" "" ""
      test_enums
  
      # Now some random tests that were just thrown in here.
  
      gdb_breakpoint marker_reg1
--- 835,848 ----
      test_method_param_class
  
      gdb_breakpoint enums2
!     gdb_test "continue" ".*Breakpoint .* enums2.*" "continue to enums2(\\(\\)|)"
      gdb_test "finish" "" ""
      test_enums
  
+     gdb_test "finish" "" ""
+     test_pointers_to_class_members
+     test_static_members
+ 
      # Now some random tests that were just thrown in here.
  
      gdb_breakpoint marker_reg1
*************** proc do_tests {} {
*** 847,852 ****
--- 877,887 ----
  	    fail "calling method for small class"
  	}
      }
+ 
+     # This is a random v2 demangling test.
+     # This is redundant with existing tests in demangle.exp.
+     # TODO: Just remove this.
+     gdb_test "maint demangle inheritance1__Fv" "inheritance1\\(void\\)" "demangle"
  }
  
  do_tests
Index: derivation.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/derivation.exp,v
retrieving revision 1.3
diff -c -3 -p -r1.3 derivation.exp
*** derivation.exp	1 Jan 2004 06:58:44 -0000	1.3
--- derivation.exp	2 Jan 2004 04:16:39 -0000
*************** set re_methods		"A\\((void|)\\);${ws}int
*** 74,132 ****
  set re_synth_gcc_23	"A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);"
  set re_all_methods	"($re_methods|$re_methods${ws}$re_synth_gcc_23|$re_synth_gcc_23${ws}$re_methods)"
  
  gdb_test_multiple "ptype a_instance" "ptype a_instance" {
!     -re "type = $re_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	pass "ptype a_instance"
      }
  }
  
- gdb_test "print a_instance" "\\$\[0-9\]+ = \{a = 1, aa = 2\}" "print value of a_instance"
- 
  # class D
  
  set re_class		"class D : private A, public B, protected C \{${ws}public:"
! set re_class_BAD	"class D : private A, public B, private C \{${ws}public:"
  set re_fields		"int d;${ws}int dd;"
  set re_methods		"D\\((void|)\\);${ws}int dfoo\\((void|)\\);${ws}int foo\\((void|)\\);"
  set re_synth_gcc_23	"D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);"
  set re_all_methods	"($re_methods|$re_methods${ws}$re_synth_gcc_23|$re_synth_gcc_23${ws}$re_methods)"
  
  gdb_test_multiple "ptype d_instance" "ptype d_instance" {
      -re "type = $re_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
  	pass "ptype d_instance"
      }
!     -re "type = $re_class_BAD${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	kfail "gdb/1498" "ptype d_instance"
!     }
! }
! 
! gdb_test_multiple "print d_instance" "print value of d_instance" {
!     -re "\\$\[0-9\]+ = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, d = 7, dd = 8\}$nl$gdb_prompt $" {
! 	pass "print value of d_instance"
      }
  }
  
  # class E
  
  set re_class		"class E : public A, private B, protected C \{${ws}public:"
! set re_class_BAD	"class E : public A, private B, private C \{${ws}public:"
  set re_fields		"int e;${ws}int ee;"
  set re_methods		"E\\((void|)\\);${ws}int efoo\\((void|)\\);${ws}int foo\\((void|)\\);"
  set re_synth_gcc_23	"E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);"
  set re_all_methods	"($re_methods|$re_methods${ws}$re_synth_gcc_23|$re_synth_gcc_23${ws}$re_methods)"
  
  gdb_test_multiple "ptype e_instance" "ptype e_instance" {
      -re "type = $re_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
  	pass "ptype e_instance"
      }
!     -re "type = $re_class_BAD${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	kfail "gdb/1498" "ptype e_instance"
!     }
! }
! 
! gdb_test_multiple "print e_instance" "print value of e_instance" {
!     -re "\\$\[0-9\]+ = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, e = 9, ee = 10\}$nl$gdb_prompt $" {
! 	pass "print value of e_instance"
      }
  }
  
--- 74,163 ----
  set re_synth_gcc_23	"A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);"
  set re_all_methods	"($re_methods|$re_methods${ws}$re_synth_gcc_23|$re_synth_gcc_23${ws}$re_methods)"
  
+ gdb_test "print a_instance" "\\$\[0-9\]+ = \{a = 1, aa = 2\}" "print value of a_instance"
+ 
  gdb_test_multiple "ptype a_instance" "ptype a_instance" {
!     -re "type = $re_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" {
! 	pass "ptype a_instance (no synth ops)"
!     }
!     -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23${ws}$re_methods${ws}$nl\}$nl$gdb_prompt $" {
! 	pass "ptype a_instance (with synth ops)"
!     }
!     -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
! 	# TODO: this is fine, it's just gcc abi 2
! 	# pass "ptype a_instance (with synth ops) (abi 2)"
! 	fail "ptype a_instance"
      }
  }
  
  # class D
  
  set re_class		"class D : private A, public B, protected C \{${ws}public:"
! set XX_class		"class D : private A, public B, private C \{${ws}public:"
  set re_fields		"int d;${ws}int dd;"
  set re_methods		"D\\((void|)\\);${ws}int dfoo\\((void|)\\);${ws}int foo\\((void|)\\);"
  set re_synth_gcc_23	"D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);"
  set re_all_methods	"($re_methods|$re_methods${ws}$re_synth_gcc_23|$re_synth_gcc_23${ws}$re_methods)"
  
+ gdb_test_multiple "print d_instance" "print value of d_instance" {
+     -re "\\$\[0-9\]+ = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, d = 7, dd = 8\}$nl$gdb_prompt $" {
+ 	pass "print value of d_instance"
+     }
+ }
+ 
  gdb_test_multiple "ptype d_instance" "ptype d_instance" {
+     -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ 	# TODO: this is okay, gcc abi 2.
+ 	fail "ptype d_instance"
+     }
      -re "type = $re_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
  	pass "ptype d_instance"
      }
!     -re "type = $XX_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
! 	# TODO: this is okay, gcc abi 2.
! 	# kfail "gdb/1498" "ptype d_instance"
! 	fail "ptype d_instance"
!     }
!     -re "type = $XX_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	# TODO: this is a gcc bug.
! 	# kfail "gdb/1498" "ptype d_instance"
! 	pass "ptype d_instance"
      }
  }
  
  # class E
  
  set re_class		"class E : public A, private B, protected C \{${ws}public:"
! set XX_class		"class E : public A, private B, private C \{${ws}public:"
  set re_fields		"int e;${ws}int ee;"
  set re_methods		"E\\((void|)\\);${ws}int efoo\\((void|)\\);${ws}int foo\\((void|)\\);"
  set re_synth_gcc_23	"E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);"
  set re_all_methods	"($re_methods|$re_methods${ws}$re_synth_gcc_23|$re_synth_gcc_23${ws}$re_methods)"
  
+ gdb_test_multiple "print e_instance" "print value of e_instance" {
+     -re "\\$\[0-9\]+ = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, e = 9, ee = 10\}$nl$gdb_prompt $" {
+ 	pass "print value of e_instance"
+     }
+ }
+ 
  gdb_test_multiple "ptype e_instance" "ptype e_instance" {
+     -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ 	# TODO: this is okay, just gcc abi 2
+ 	fail "ptype e_instance"
+     }
      -re "type = $re_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
  	pass "ptype e_instance"
      }
!     -re "type = $XX_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
! 	# TODO: this is okay, just gcc abi 2
! 	# TODO: this is a gcc bug.
! 	# kfail "gdb/1498" "ptype e_instance"
! 	fail "ptype e_instance"
!     }
!     -re "type = $XX_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	# TODO: this is a gcc bug.
! 	# kfail "gdb/1498" "ptype e_instance"
! 	pass "ptype e_instance"
      }
  }
  
*************** set re_methods		"F\\((void|)\\);${ws}int
*** 138,152 ****
  set re_synth_gcc_23	"F & operator=\\(F const ?&\\);${ws}F\\(F const ?&\\);"
  set re_all_methods	"($re_methods|$re_methods${ws}$re_synth_gcc_23|$re_synth_gcc_23${ws}$re_methods)"
  
- gdb_test_multiple "ptype f_instance" "ptype f_instance" {
-     -re "type = $re_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
- 	pass "ptype f_instance"
-     }
- }
- 
  gdb_test_multiple "print f_instance" "print value of f_instance" {
      -re "\\$\[0-9\]+ = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, f = 11, ff = 12\}$nl$gdb_prompt $" {
  	pass "print value of f_instance"
      }
  }
  
--- 169,187 ----
  set re_synth_gcc_23	"F & operator=\\(F const ?&\\);${ws}F\\(F const ?&\\);"
  set re_all_methods	"($re_methods|$re_methods${ws}$re_synth_gcc_23|$re_synth_gcc_23${ws}$re_methods)"
  
  gdb_test_multiple "print f_instance" "print value of f_instance" {
      -re "\\$\[0-9\]+ = \{<(class A|A)> = \{a = 1, aa = 2\}, <(class B|B)> = \{b = 3, bb = 4\}, <(class C|C)> = \{c = 5, cc = 6\}, f = 11, ff = 12\}$nl$gdb_prompt $" {
  	pass "print value of f_instance"
+     }
+ }
+ 
+ gdb_test_multiple "ptype f_instance" "ptype f_instance" {
+     -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23$nl\}$nl$gdb_prompt $" {
+ 	# TODO: this is okay, just gcc abi 2
+ 	fail "ptype f_instance"
+     }
+     -re "type = $re_class${ws}$re_fields${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
+ 	pass "ptype f_instance"
      }
  }
  
Index: overload.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/overload.exp,v
retrieving revision 1.2
diff -c -3 -p -r1.2 overload.exp
*** overload.exp	1 Jan 2004 09:46:21 -0000	1.2
--- overload.exp	2 Jan 2004 04:16:39 -0000
*************** gdb_test "up" ".*main.*" "up from marker
*** 64,69 ****
--- 64,70 ----
  #
  # This is hairy to begin with.  It is even more hairy because of the
  # XX_* alternate patterns to catch the KFAIL and XFAIL cases.
+ # TODO: And then hair^3 to reutrn the same results as the old tests.
  
  set re_class	"((struct|class) foo \{${ws}public:|struct foo \{)"
  set re_fields	"int ifoo;${ws}const char ?\\* ?ccpfoo;"
*************** set re_methods	"${re_methods}${ws}int ov
*** 100,134 ****
  set re_methods	"${re_methods}${ws}int overloadargs\\(int, int, int, int, int, int, int, int, int, int\\);"
  set re_methods	"${re_methods}${ws}int overloadargs\\(int, int, int, int, int, int, int, int, int, int, int\\);"
  set re_synth	"foo & operator=\\(foo const ?&\\);"
! set re_all_m	 	 "($re_ctor${ws}$re_dtor${ws}$re_methods"
! set re_all_m	"$re_all_m|$re_ctor${ws}$re_dtor${ws}$re_methods${ws}$re_synth"
! set re_all_m	"$re_all_m|$re_synth${ws}$re_ctor${ws}$re_dtor${ws}$re_methods"
! set re_all_m	"$re_all_m|$re_synth${ws}$re_dtor${ws}$re_ctor${ws}$re_methods"
! set re_all_m	"$re_all_m)"
! set XX_all_m	"$re_ctor${ws}$XX_dtor${ws}$re_methods"
  
  gdb_test_multiple "ptype foo_instance1" "ptype foo_instance1" {
!     -re "type = $re_class${ws}$re_fields${ws}$re_all_m$nl\}$nl$gdb_prompt $" {
! 	pass "ptype foo_instance1"
      }
!     -re "type = $re_class${ws}$XX_fields${ws}$re_all_m$nl\}$nl$gdb_prompt $" {
  	# gcc 2.95.3 -gstabs+, no "const" on "const char *"
  	# TODO: gdb.base/constvar.exp has XFAILed this kind of problem for a
  	# long time, but an XFAIL really needs an external bug report.
  	# -- chastain 2003-12-31
! 	setup_xfail "*-*-*"
! 	fail "ptype foo_instance1"
      }
!     -re "type = $re_class${ws}$re_fields${ws}$XX_all_m$nl\}$nl$gdb_prompt $" {
  	# gcc 3.3.2 -gdwarf-2, "~foo(int)"
! 	kfail "gdb/1113" "ptype foo_instance1"
      }
  }
  
  # Print variables and method calls.
  # This is a walk in the park.
  
- gdb_test "print foo_instance1" "\\$\[0-9\]+ = \{ifoo = 111, ccpfoo = 0x0\}"
  gdb_test "print foo_instance2" "\\$\[0-9\]+ = \{ifoo = 222, ccpfoo = $hex \"A\"\}"
  gdb_test "print foo_instance3" "\\$\[0-9\]+ = \{ifoo = 222, ccpfoo = $hex \"A\"\}"
  
--- 101,157 ----
  set re_methods	"${re_methods}${ws}int overloadargs\\(int, int, int, int, int, int, int, int, int, int\\);"
  set re_methods	"${re_methods}${ws}int overloadargs\\(int, int, int, int, int, int, int, int, int, int, int\\);"
  set re_synth	"foo & operator=\\(foo const ?&\\);"
! 
! gdb_test "print foo_instance1" "\\$\[0-9\]+ = \{ifoo = 111, ccpfoo = 0x0\}"
  
  gdb_test_multiple "ptype foo_instance1" "ptype foo_instance1" {
!     -re "type = $re_class${ws}$re_fields${ws}$re_ctor${ws}$re_dtor${ws}$re_methods$nl\}$nl$gdb_prompt $" {
! 	# gcc 2.95.3 -gdwarf-2
! 	# TODO: this is not a quirk!
! 	pass "ptype foo_instance1 (HP aCC -- known quirk with ~foo parameter list)"
      }
!     -re "type = $re_class${ws}$XX_fields${ws}$re_synth${ws}$re_dtor${ws}$re_ctor${ws}$re_methods$nl\}$nl$gdb_prompt $" {
  	# gcc 2.95.3 -gstabs+, no "const" on "const char *"
  	# TODO: gdb.base/constvar.exp has XFAILed this kind of problem for a
  	# long time, but an XFAIL really needs an external bug report.
  	# -- chastain 2003-12-31
! 	# setup_xfail "*-*-*"
! 	# fail "ptype foo_instance1"
! 	# TODO: this should be a KFAIL.
! 	pass "ptype foo_instance1 (shorter match)"
!     }
!     -re "type = $re_class${ws}$re_fields${ws}$re_synth${ws}$re_dtor${ws}$re_ctor${ws}$re_methods$nl\}$nl$gdb_prompt $" {
! 	# gcc 2.95.3 -gstabs+ if "const char *" ever gets fixed
! 	pass "ptype foo_instance1"
      }
!     -re "type = $re_class${ws}$re_fields${ws}$re_ctor${ws}$XX_dtor${ws}$re_methods$nl\}$nl$gdb_prompt $" {
  	# gcc 3.3.2 -gdwarf-2, "~foo(int)"
! 	# TODO: kfail this
! 	# kfail "gdb/1113" "ptype foo_instance1"
! 	pass "ptype foo_instance1 (shorter match)"
!     }
!     -re "type = $re_class${ws}$re_fields${ws}$re_ctor${ws}$re_dtor${ws}$re_methods$nl\}$nl$gdb_prompt $" {
! 	# gcc 3.3.2 -gdwarf-2, if the dtor bug gets fixed
! 	# gcc HEAD -gdwarf-2 (abi-2)
! 	# TODO: just pass this
! 	pass "ptype foo_instance1 (shorter match)"
!     }
!     -re "type = $re_class${ws}$re_fields${ws}$re_synth${ws}$re_ctor${ws}$re_dtor${ws}$re_methods$nl\}$nl$gdb_prompt $" {
! 	# gcc 3.3.2 -gstabs+
! 	# TODO: enough with the "shorter match"
! 	pass "ptype foo_instance1 (shorter match)"
!     }
!     -re "type = $re_class${ws}$re_fields${ws}$re_ctor${ws}$re_dtor${ws}$re_methods${ws}$re_synth$nl\}$nl$gdb_prompt $" {
! 	# gcc HEAD -gstabs+ (abi-2)
! 	# TODO: just pass this
! 	# pass "ptype foo_instance1"
! 	fail "ptype foo_instance1"
      }
  }
  
  # Print variables and method calls.
  # This is a walk in the park.
  
  gdb_test "print foo_instance2" "\\$\[0-9\]+ = \{ifoo = 222, ccpfoo = $hex \"A\"\}"
  gdb_test "print foo_instance3" "\\$\[0-9\]+ = \{ifoo = 222, ccpfoo = $hex \"A\"\}"
  
Index: virtfunc.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/virtfunc.exp,v
retrieving revision 1.4
diff -c -3 -p -r1.4 virtfunc.exp
*** virtfunc.exp	1 Jan 2004 23:05:12 -0000	1.4
--- virtfunc.exp	2 Jan 2004 04:16:40 -0000
***************
*** 21,28 ****
  # This file was written by Fred Fish. (fnf@cygnus.com)
  # And rewritten by Michael Chastain <mec.gnu@mindspring.com>.
  
! set ws "\[\r\n\t \]+"
! set nl "\[\r\n\]+"
  
  if $tracelevel then {
      strace $tracelevel
--- 21,29 ----
  # This file was written by Fred Fish. (fnf@cygnus.com)
  # And rewritten by Michael Chastain <mec.gnu@mindspring.com>.
  
! set wsopt	"\[\r\n\t \]*"
! set ws		"\[\r\n\t \]+"
! set nl		"\[\r\n\]+"
  
  if $tracelevel then {
      strace $tracelevel
*************** if  { [gdb_compile "${srcdir}/${subdir}/
*** 38,44 ****
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
  }
  
! # Test ptype of class objects.
  #
  # Different C++ compilers produce different output.  I build up regular
  # expressions piece by piece to accommodate all the compilers that I
--- 39,45 ----
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
  }
  
! # Test ptype of a class.
  #
  # Different C++ compilers produce different output.  I build up regular
  # expressions piece by piece to accommodate all the compilers that I
*************** if  { [gdb_compile "${srcdir}/${subdir}/
*** 52,58 ****
  #       V * _vb$V;			// re_vbptr
  #       int a;				// re_fields
  #
! #     public:
  #       A & operator=(A const &);	// re_synth_gcc_2
  #       A(int, A const &);		// ...
  #       A(int);				// ...
--- 53,59 ----
  #       V * _vb$V;			// re_vbptr
  #       int a;				// re_fields
  #
! #     public:				// re_access_methods
  #       A & operator=(A const &);	// re_synth_gcc_2
  #       A(int, A const &);		// ...
  #       A(int);				// ...
*************** if  { [gdb_compile "${srcdir}/${subdir}/
*** 66,73 ****
  #   class ... { private: ... };
  #   class ... { ... };
  #
! # RE_VBPTR matches the virtual base declarations.  gcc 2.95.3 emits
! # these, but gcc 3.X.Y does not.  The name depends on the debug format.
  #
  # RE_FIELDS matches the data fields of the class.
  # RE_METHODS matches the methods explicitly declared for the class.
--- 67,75 ----
  #   class ... { private: ... };
  #   class ... { ... };
  #
! # RE_VBPTR matches the virtual base declarations.  gcc 2.95.3 sometimes
! # emits these, but gcc 3.X.Y never emits these.  The name depends on the
! # debug format.
  #
  # RE_FIELDS matches the data fields of the class.
  # RE_METHODS matches the methods explicitly declared for the class.
*************** if  { [gdb_compile "${srcdir}/${subdir}/
*** 76,429 ****
  # of the class.  gcc -gstabs+ emits these methods, and gcc -gdwarf-2
  # does not.
  #
! # RE_ALL_METHODS combines RE_METHODS and the optional synthetic methods.
! # Up to gcc 3.3.X, gcc defaults to gcc ABI 1, with synthetic methods at
! # the beginning.  Starting with gcc 3.4.X, gcc defaults to gcc ABI 2,
! # with synthetic methods at the end.
! #
! # So the possible choices for RE_ALL_METHODS are:
! #
! #   RE_METHODS			// any gcc with dwarf-2
! #   RE_SYNTH_GCC_2|RE_METHODS	// gcc 2.95.3, stabs+
! #   RE_SYNTH_GCC_3|RE_METHODS	// gcc 3.3.2, stabs+
! #   RE_METHODS|RE_SYNTH_GCC_3	// gcc 3.4.0, stabs+
  #
! # When I get HP-UX aCC, I hope that I can just add RE_SYNTH_ACC_FOO
! # and enlarge RE_ALL_METHODS.
  #
  # Yet another twist: with gcc v2, ctor and dtor methods have a hidden
  # argument in front, the "in-charge" flag.  With gcc v3, there is no
  # hidden argument; instead, there are multiple object functions for
  # each ctor and dtor.
  #
! # I use gdb_test_multiple with only one arm.  I could use gdb_test,
! # but gdb_test_multiple makes it easier to add KFAIL arms as needed.
! #
! # -- chastain 2003-12-31
  
! proc test_ptype_of_classes {} {
      global gdb_prompt
      global ws
      global nl
  
!     # class VA
! 
!     set re_class	"((struct|class) VA \{${ws}public:|struct VA \{)"
!     set re_fields	"int va;"
!     set re_synth_gcc_23	"VA & operator=\\(VA const ?&\\);${ws}VA\\(VA const ?&\\);${ws}VA\\((void|)\\);"
!     set re_all_methods	"(|$re_synth_gcc_23)"
! 
!     gdb_test_multiple "ptype VA" "ptype VA" {
! 	-re "type = $re_class${ws}$re_fields${ws}(public:${ws}|)$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype VA"
  	}
      }
  
!     # class VB
  
!     set re_class	"((struct|class) VB \{${ws}public:|struct VB \{)"
!     set re_fields	"int vb;"
!     set re_methods	"int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);"
!     set re_synth_gcc_23	"VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);"
!     set re_all_methods	"($re_methods|$re_methods${ws}$re_synth_gcc_23|$re_synth_gcc_23${ws}$re_methods)"
! 
!     gdb_test_multiple "ptype VB" "ptype VB" {
! 	-re "type = $re_class${ws}$re_fields${ws}(public:${ws}|)$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype VB"
! 	}
!     }
  
!     # An instance of VB
  
!     gdb_test_multiple "ptype vb" "ptype vb" {
! 	-re "type = $re_class${ws}$re_fields${ws}(public:${ws}|)$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype vb"
! 	}
!     }
  
!     # An instance of VB *
  
!     gdb_test_multiple "ptype pVB" "ptype pVB" {
! 	-re "type = $re_class${ws}$re_fields${ws}(public:${ws}|)$re_all_methods$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pVB"
! 	}
!     }
  
      # class V
  
!     set re_class	"class V : public VA, public VB \{${ws}public:"
!     set re_fields	"int w;"
!     set re_methods	"int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);"
!     set re_synth_gcc_23	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);"
!     set re_all_methods	"($re_methods|$re_methods${ws}$re_synth_gcc_23|$re_synth_gcc_23${ws}$re_methods)"
! 
!     gdb_test_multiple "ptype V" "ptype V" {
! 	-re "type = $re_class${ws}$re_fields${ws}(public:${ws}|)$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype V"
! 	}
!     }
  
!     # An instance of V
  
!     gdb_test_multiple "ptype v" "ptype v" {
! 	-re "type = $re_class${ws}$re_fields${ws}(public:${ws}|)$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype v"
! 	}
!     }
  
!     # An instance of V *
  
!     gdb_test_multiple "ptype pVa" "ptype pVa" {
! 	-re "type = $re_class${ws}$re_fields${ws}(public:${ws}|)$re_all_methods$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pVa"
! 	}
!     }
  
!     # An instance of V *
  
!     gdb_test_multiple "ptype pVv" "ptype pVv" {
! 	-re "type = $re_class${ws}$re_fields${ws}(public:${ws}|)$re_all_methods$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pVv"
! 	}
!     }
  
!     # An instance of V *
  
!     gdb_test_multiple "ptype pVe" "ptype pVe" {
! 	-re "type = $re_class${ws}$re_fields${ws}(public:${ws}|)$re_all_methods$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pVe"
! 	}
!     }
  
!     # An instance of V *
  
!     gdb_test_multiple "ptype pVd" "ptype pVd" {
! 	-re "type = $re_class${ws}$re_fields${ws}(public:${ws}|)$re_all_methods$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pVd"
! 	}
!     }
  
!     # class A
  
!     set re_class	"class A : public virtual V \{(${ws}private:|)"
!     set re_vbptr 	"V \\*(_vb.1V|_vb.V);"
!     set re_fields	"int a;"
!     set re_methods	"virtual int f\\((void|)\\);"
!     # gcc 2 adds an "in-charge" arg to the ctor.
!     set re_synth_gcc_2	"A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);"
!     set re_synth_gcc_3	"A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);"
!     set re_all_methods	"($re_methods|$re_synth_gcc_2${ws}$re_methods|$re_synth_gcc_3${ws}$re_methods|$re_methods${ws}$re_synth_gcc_3)"
! 
!     gdb_test_multiple "ptype A" "ptype A" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)${re_fields}${ws}public:${ws}${re_all_methods}$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype A"
! 	}
!     }
  
!     # An instance of A
  
!     gdb_test_multiple "ptype a" "ptype a" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)${re_fields}${ws}public:${ws}${re_all_methods}$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype a"
! 	}
!     }
  
!     # An instance of A *
  
!     gdb_test_multiple "ptype pAa" "ptype pAa" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)${re_fields}${ws}public:${ws}${re_all_methods}$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pAa"
! 	}
!     }
  
!     # An instance of A *
  
!     gdb_test_multiple "ptype pAe" "ptype pAe" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)${re_fields}${ws}public:${ws}${re_all_methods}$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pAe"
! 	}
!     }
  
!     # class B
  
!     set re_class	"class B : public A \{(${ws}private:|)"
!     set re_vbptr	"V \\*(_vb.1V|_vb.V);"
!     set re_fields	"int b;"
!     set re_methods	"virtual int f\\((void|)\\);"
!     set re_synth_gcc_2	"B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);"
!     set re_synth_gcc_3	"B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);"
!     set re_all_methods	"($re_methods|$re_synth_gcc_2${ws}$re_methods|$re_synth_gcc_3${ws}$re_methods|$re_methods${ws}$re_synth_gcc_3)"
! 
!     gdb_test_multiple "ptype B" "ptype B" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)${re_fields}${ws}public:${ws}${re_all_methods}$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype B"
! 	}
!     }
  
      # An instance of B
  
!     gdb_test_multiple "ptype b" "ptype b" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)${re_fields}${ws}public:${ws}${re_all_methods}$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype b"
! 	}
!     }
  
!     # An instance of B *
! 
!     gdb_test_multiple "ptype pBe" "ptype pBe" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)${re_fields}${ws}public:${ws}${re_all_methods}$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pBe"
! 	}
!     }
  
!     # class C
  
!     set re_class	"class C : public virtual V \{(${ws}private:|)"
!     set re_vbptr	"V \\*(_vb.1V|_vb.V);"
!     set re_fields	"int c;"
!     set re_synth_gcc_2	"C & operator=\\(C const ?&\\);${ws}C\\(int, C const ?&\\);${ws}C\\(int\\);"
!     set re_synth_gcc_3	"C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\(\\);"
!     set re_all_methods	"(|$re_synth_gcc_2|$re_synth_gcc_3)"
! 
!     gdb_test_multiple "ptype C" "ptype C" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)public:${ws}${re_fields}${ws}(public:${ws}|)${re_all_methods}$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype C"
! 	}
!     }
  
!     # An instance of C
  
!     gdb_test_multiple "ptype c" "ptype c" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)public:${ws}${re_fields}${ws}(public:${ws}|)${re_all_methods}$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype c"
! 	}
!     }
  
!     # class AD
  
!     set re_class	"((struct|class) AD \{${ws}public:|struct AD \{)"
!     set re_methods	"virtual int vg\\((void|)\\);"
!     set re_synth_gcc_23	"AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);"
!     set re_all_methods	"($re_methods|$re_methods${ws}$re_synth_gcc_23|$re_synth_gcc_23${ws}$re_methods)"
! 
!     gdb_test_multiple "ptype AD" "ptype AD" {
! 	-re "type = $re_class${ws}$re_all_methods$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype AD"
! 	}
!     }
  
!     # An instance of AD *
!     # TODO: this should be named pADd, not pAd.
  
!     gdb_test_multiple "ptype pAd" "ptype pAd" {
! 	-re "type = $re_class${ws}$re_all_methods$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pAd"
! 	}
!     }
  
!     # An instance of a AD *
  
!     gdb_test_multiple "ptype pADe" "ptype pADe" {
! 	-re "type = $re_class${ws}$re_all_methods$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pADe"
! 	}
!     }
  
!     # class D
!     #
!     # I wrote this differently from the others to avoid a problem with
!     # the sourceware version of expect, which dates from 1998.
!     # The bug manifests as ERROR/UNRESOLVED results after an "eof"
!     # in gdb_test_multiple.
!     #
!     # -- chastain 2004-01-01
! 
!     set re_class	"class D : public AD, public virtual V \{(${ws}private:|)"
!     set re_vbptr	"V \\*(_vb.1V|_vb.V);"
!     set re_fields	"int d;"
!     set re_methods_2	"static void s\\(void\\);${ws}virtual int vg\\(void\\);${ws}virtual int vd\\(void\\);${ws}int fd\\(void\\);"
!     set re_methods_3	"static void s\\(\\);${ws}virtual int vg\\(\\);${ws}virtual int vd\\(\\);${ws}int fd\\(\\);"
!     set re_synth_gcc_2	"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);"
!     set re_synth_gcc_3	"D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);"
!     set re_all_methods	"($re_methods_2|$re_methods_3|$re_synth_gcc_2${ws}$re_methods_2|$re_synth_gcc_3${ws}$re_methods_3|$re_methods${ws}$re_synth_gcc_3)"
! 
!     gdb_test_multiple "ptype D" "ptype D" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)public:${ws}${re_fields}${ws}${re_all_methods}$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype D"
! 	}
!     }
  
!     # An instance of D
  
!     gdb_test_multiple "ptype d" "ptype d" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)public:${ws}${re_fields}${ws}${re_all_methods}$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype d"
! 	}
!     }
  
!     # An instance of D
  
!     gdb_test_multiple "ptype dd" "ptype dd" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)public:${ws}${re_fields}${ws}${re_all_methods}$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype dd"
! 	}
!     }
  
      # An instance of D *
  
!     gdb_test_multiple "ptype ppd" "ptype ppd" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)public:${ws}${re_fields}${ws}${re_all_methods}$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype ppd"
! 	}
!     }
  
      # An instance of D *
  
!     gdb_test_multiple "ptype pDd" "ptype pDd" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)public:${ws}${re_fields}${ws}${re_all_methods}$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pDd"
! 	}
!     }
  
!     # An instance of D *
  
!     gdb_test_multiple "ptype pDe" "ptype pDe" {
! 	-re "type = ${re_class}${ws}(${re_vbptr}${ws}|)public:${ws}${re_fields}${ws}${re_all_methods}$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pDe"
! 	}
!     }
  
!     # class E
!     # TODO: E does not show a vbptr for V.  That seems strange.
  
!     set re_class	"class E : public B, public virtual V, public D, public C \{(${ws}private:|)"
!     set re_fields	"int e;"
!     set re_methods	"virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);"
!     set re_synth_gcc_2	"E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);"
!     set re_synth_gcc_3	"E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);"
!     set re_all_methods	"($re_methods|$re_synth_gcc_2${ws}$re_methods|$re_synth_gcc_3${ws}$re_methods|$re_methods${ws}$re_synth_gcc_3)"
! 
!     gdb_test_multiple "ptype E" "ptype E" {
! 	-re "type = ${re_class}${ws}public:${ws}${re_fields}${ws}${re_all_methods}$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype E"
! 	}
!     }
  
!     # An instance of E
  
!     gdb_test_multiple "ptype e" "ptype e" {
! 	-re "type = ${re_class}${ws}public:${ws}${re_fields}${ws}${re_all_methods}$nl\}$nl$gdb_prompt $" {
! 	    pass "ptype e"
! 	}
!     }
  
      # An instance of E *
  
!     gdb_test_multiple "ptype pEe" "ptype pEe" {
! 	-re "type = ${re_class}${ws}public:${ws}${re_fields}${ws}${re_all_methods}$nl\} \\*$nl$gdb_prompt $" {
! 	    pass "ptype pEe"
! 	}
!     }
  }
  
  # Call virtual functions.
--- 78,606 ----
  # of the class.  gcc -gstabs+ emits these methods, and gcc -gdwarf-2
  # does not.
  #
! # RE_ACCESS_METHODS is an access specifier after RE_FIELDS and before
! # the methods (explicit methods and/or synthetic methods).
! # There is also an RE_ACCESS_FIELDS.
  #
! # When I get HP-UX aCC, I hope that I can just add RE_SYNTH_ACC_NNN.
  #
  # Yet another twist: with gcc v2, ctor and dtor methods have a hidden
  # argument in front, the "in-charge" flag.  With gcc v3, there is no
  # hidden argument; instead, there are multiple object functions for
  # each ctor and dtor.
  #
! # -- chastain 2004-01-01
  
! # compatibility kludges
! set kk0 ""
! set kk1 ""
! set kk2 ""
! set kk3 ""
! set kk4 ""
! set kk5 ""
! set fk5 ""
! 
! proc kk_debug { } {
!     global kk0
!     global kk1
!     global kk2
!     global kk3
!     global kk4
!     global kk5
!     global fk5
!     set kk0 " (0)"
!     set kk1 " (1)"
!     set kk2 " (2)"
!     set kk3 " (3)"
!     set kk4 " (4)"
!     set kk5 " (5)"
!     set fk5 ""
! }
! 
! proc test_one_ptype { command testname re_class re_vbptr re_access_fields re_fields re_access_methods re_methods re_synth_gcc_2 re_synth_gcc_3 re_star } {
      global gdb_prompt
+     global wsopt
      global ws
      global nl
  
!     global kk0
!     global kk1
!     global kk2
!     global kk3
!     global kk4
!     global kk5
!     global fk5
! 
!     gdb_test_multiple "$command" "$testname" {
! 	-re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
! 	    # gcc 2.95.3, dwarf-2, no vbptr
! 	    # gcc 3.X, abi 1, dwarf-2
! 	    # gcc 3.X, abi 2, dwarf-2
! 	    pass "$testname$kk0"
! 	}
! 	-re "type = $re_class${wsopt}$re_vbptr${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
! 	    # gcc 2.95.3, dwarf-2, vbptr
! 	    # TODO: drow says the vbptr is a bug
! 	    pass "$testname$kk1"
! 	}
! 	-re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_synth_gcc_2${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
! 	    # gcc 2.95.3, stabs+, no vbptr
! 	    pass "$testname$kk2"
! 	}
! 	-re "type = $re_class${wsopt}$re_vbptr${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_synth_gcc_2${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
! 	    # gcc 2.95.3, stabs+, vbptr
! 	    # TODO: drow says the vbptr is a bug
! 	    pass "$testname$kk3"
! 	}
! 	-re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_synth_gcc_3${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
! 	    # gcc 3.X, abi 1, stabs+
! 	    pass "$testname$kk4"
! 	}
! 	-re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_methods${wsopt}$re_synth_gcc_3$nl\}$re_star$nl$gdb_prompt $" {
! 	    # gcc 3.X, abi 2, stabs+
! 	    if { "$fk5" == "fail" } {
! 		fail "$testname$kk5"
! 	    } else {
! 		pass "$testname$kk5"
! 	    }
  	}
      }
  
!     set kk0 ""
!     set kk1 ""
!     set kk2 ""
!     set kk3 ""
!     set kk4 ""
!     set kk5 ""
!     set fk5 ""
! }
  
! proc test_ptype_of_classes {} {
!     global gdb_prompt
!     global ws
!     global nl
  
!     global kk0
!     global kk1
!     global kk2
!     global kk3
!     global kk4
!     global kk5
!     global fk5
  
!     # class VA
  
!     set kk0 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype VA" "ptype VA" \
! 	"((struct|class) VA \{${ws}public:|struct VA \{)" \
! 	"" \
! 	"" "int va;" \
! 	"" "" \
! 	"VA & operator=\\(VA const ?&\\);${ws}VA\\(VA const ?&\\);${ws}VA\\((void|)\\);" \
! 	"VA & operator=\\(VA const ?&\\);${ws}VA\\(VA const ?&\\);${ws}VA\\((void|)\\);" \
! 	""
  
!     # class VB
! 
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype VB" "ptype VB" \
! 	"((struct|class) VB \{${ws}public:|struct VB \{)" \
! 	"" \
! 	"" "int vb;" \
! 	"" "int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);" \
! 	"VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
! 	"VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
! 	""
  
      # class V
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype V" "ptype V" \
! 	"class V : public VA, public VB \{${ws}public:" \
! 	"" \
! 	"" "int w;" \
! 	"" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	""
  
!     # class A
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype A" "ptype A" \
! 	"class A : public virtual V \{(${ws}private:|)" \
! 	"V \\*(_vb.1V|_vb.V);" \
! 	"" "int a;" \
! 	"public:" "virtual int f\\((void|)\\);" \
! 	"A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
! 	"A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
! 	""
  
!     # class B
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype B" "ptype B" \
! 	"class B : public A \{(${ws}private:|)" \
! 	"V \\*(_vb.1V|_vb.V);" \
! 	"" "int b;" \
! 	"public:" "virtual int f\\((void|)\\);" \
! 	"B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
! 	"B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
! 	""
  
!     # class C
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype C" "ptype C" \
! 	"class C : public virtual V \{(${ws}private:|)" \
! 	"V \\*(_vb.1V|_vb.V);" \
! 	"public:" "int c;" \
! 	"" "" \
! 	"C & operator=\\(C const ?&\\);${ws}C\\(int, C const ?&\\);${ws}C\\(int\\);" \
! 	"C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\(\\);" \
! 	""
  
!     # class AD
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype AD" "ptype AD" \
! 	"((struct|class) AD \{${ws}public:|struct AD \{)" \
! 	"" \
! 	"" "" \
!     	"" "virtual int vg\\((void|)\\);" \
! 	"AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
! 	"AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
! 	""
  
!     # class D
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype D" "ptype D" \
! 	"class D : public AD, public virtual V \{(${ws}private:|)" \
!     	"V \\*(_vb.1V|_vb.V);" \
!     	"public:" "int d;" \
! 	"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
! 	""
  
!     # class E
!     # TODO: E does not show a vbptr for V.  That seems strange.
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype E" "ptype E" \
! 	"class E : public B, public virtual V, public D, public C \{(${ws}private:|)" \
! 	"" \
! 	"public:" "int e;" \
! 	"" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
! 	"E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
! 	"E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
! 	""
  
!     # An instance of D
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype dd" "ptype dd" \
! 	"class D : public AD, public virtual V \{(${ws}private:|)" \
!     	"V \\*(_vb.1V|_vb.V);" \
!     	"public:" "int d;" \
! 	"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
! 	""
  
!     # An instance of D *
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype ppd" "ptype ppd" \
! 	"class D : public AD, public virtual V \{(${ws}private:|)" \
!     	"V \\*(_vb.1V|_vb.V);" \
!     	"public:" "int d;" \
! 	"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
! 	" ?\\*"
  
!     # An instance of AD *
!     # TODO: this should be named pADd, not pAd.
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype pAd" "ptype pAd" \
! 	"((struct|class) AD \{${ws}public:|struct AD \{)" \
! 	"" \
! 	"" "" \
!     	"" "virtual int vg\\((void|)\\);" \
! 	"AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
! 	"AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
! 	" ?\\*"
  
!     # An instance of A
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype a" "ptype a" \
! 	"class A : public virtual V \{(${ws}private:|)" \
! 	"V \\*(_vb.1V|_vb.V);" \
! 	"" "int a;" \
! 	"public:" "virtual int f\\((void|)\\);" \
! 	"A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
! 	"A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
! 	""
  
      # An instance of B
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype b" "ptype b" \
! 	"class B : public A \{(${ws}private:|)" \
! 	"V \\*(_vb.1V|_vb.V);" \
! 	"" "int b;" \
! 	"public:" "virtual int f\\((void|)\\);" \
! 	"B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
! 	"B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
! 	""
  
!     # An instance of C
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype c" "ptype c" \
! 	"class C : public virtual V \{(${ws}private:|)" \
! 	"V \\*(_vb.1V|_vb.V);" \
! 	"public:" "int c;" \
! 	"" "" \
! 	"C & operator=\\(C const ?&\\);${ws}C\\(int, C const ?&\\);${ws}C\\(int\\);" \
! 	"C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\(\\);" \
! 	""
  
!     # An instance of D
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype d" "ptype d" \
! 	"class D : public AD, public virtual V \{(${ws}private:|)" \
!     	"V \\*(_vb.1V|_vb.V);" \
!     	"public:" "int d;" \
! 	"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
! 	""
  
!     # An instance of E
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype e" "ptype e" \
! 	"class E : public B, public virtual V, public D, public C \{(${ws}private:|)" \
! 	"" \
! 	"public:" "int e;" \
! 	"" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
! 	"E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
! 	"E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
! 	""
  
!     # An instance of V
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype v" "ptype v" \
! 	"class V : public VA, public VB \{${ws}public:" \
! 	"" \
! 	"" "int w;" \
! 	"" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	""
  
!     # An instance of VB
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype vb" "ptype vb" \
! 	"((struct|class) VB \{${ws}public:|struct VB \{)" \
! 	"" \
! 	"" "int vb;" \
! 	"" "int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);" \
! 	"VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
! 	"VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
! 	""
  
!     # An instance of A *
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype pAa" "ptype pAa" \
! 	"class A : public virtual V \{(${ws}private:|)" \
! 	"V \\*(_vb.1V|_vb.V);" \
! 	"" "int a;" \
! 	"public:" "virtual int f\\((void|)\\);" \
! 	"A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
! 	"A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
! 	" ?\\*"
  
!     # An instance of A *
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype pAe" "ptype pAe" \
! 	"class A : public virtual V \{(${ws}private:|)" \
! 	"V \\*(_vb.1V|_vb.V);" \
! 	"" "int a;" \
! 	"public:" "virtual int f\\((void|)\\);" \
! 	"A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
! 	"A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
! 	" ?\\*"
  
!     # An instance of B *
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype pBe" "ptype pBe" \
! 	"class B : public A \{(${ws}private:|)" \
! 	"V \\*(_vb.1V|_vb.V);" \
! 	"" "int b;" \
! 	"public:" "virtual int f\\((void|)\\);" \
! 	"B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
! 	"B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
! 	" ?\\*"
  
      # An instance of D *
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype pDd" "ptype pDd" \
! 	"class D : public AD, public virtual V \{(${ws}private:|)" \
!     	"V \\*(_vb.1V|_vb.V);" \
!     	"public:" "int d;" \
! 	"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
! 	" ?\\*"
  
      # An instance of D *
  
!     set kk0 " (aCC)"
!     set kk1 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype pDe" "ptype pDe" \
! 	"class D : public AD, public virtual V \{(${ws}private:|)" \
!     	"V \\*(_vb.1V|_vb.V);" \
!     	"public:" "int d;" \
! 	"" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
! 	"D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
! 	" ?\\*"
  
!     # An instance of V *
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype pVa" "ptype pVa" \
! 	"class V : public VA, public VB \{${ws}public:" \
! 	"" \
! 	"" "int w;" \
! 	"" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	" ?\\*"
  
!     # An instance of V *
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype pVv" "ptype pVv" \
! 	"class V : public VA, public VB \{${ws}public:" \
! 	"" \
! 	"" "int w;" \
! 	"" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	" ?\\*"
  
!     # An instance of V *
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype pVe" "ptype pVe" \
! 	"class V : public VA, public VB \{${ws}public:" \
! 	"" \
! 	"" "int w;" \
! 	"" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	" ?\\*"
! 
!     # An instance of V *
! 
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype pVd" "ptype pVd" \
! 	"class V : public VA, public VB \{${ws}public:" \
! 	"" \
! 	"" "int w;" \
! 	"" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	"V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
! 	" ?\\*"
! 
!     # An instance of AD *
! 
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype pADe" "ptype pADe" \
! 	"((struct|class) AD \{${ws}public:|struct AD \{)" \
! 	"" \
! 	"" "" \
!     	"" "virtual int vg\\((void|)\\);" \
! 	"AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
! 	"AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
! 	" ?\\*"
  
      # An instance of E *
  
!     set kk0 " (obsolescent gcc or gdb)"
!     set fk5 "fail"
!     test_one_ptype "ptype pEe" "ptype pEe" \
! 	"class E : public B, public virtual V, public D, public C \{(${ws}private:|)" \
! 	"" \
! 	"public:" "int e;" \
! 	"" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
! 	"E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
! 	"E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
! 	" ?\\*"
! 
!     # An instance of VB *
! 
!     set kk0 " (obsolescent gcc or gdb)"
!     set kk5 " (obsolescent gcc or gdb)"
!     test_one_ptype "ptype pVB" "ptype pVB" \
! 	"((struct|class) VB \{${ws}public:|struct VB \{)" \
! 	"" \
! 	"" "int vb;" \
! 	"" "int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);" \
! 	"VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
! 	"VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
! 	" ?\\*"
  }
  
  # Call virtual functions.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]