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]

V3 fixes for classes.exp


Jim, this patch extends what you did for "ptype class A" back in April
to a bunch of other classes.  I thought you and Michael C. might review
it, since you've both worked so hard on the V3 testing issues.  
The changes:

  * Make the whitespace optional in "const &"
  * Make the "void" optional in constructors with no params
  * Make the private decl. of the vtable member optional

Also recognize a few additional constructors that were not
around before.  This does not address the issue of multiple
constructors with the same apparent type.

Michael
Index: classes.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/classes.exp,v
retrieving revision 1.7
diff -c -3 -p -r1.7 classes.exp
*** classes.exp	2001/04/24 17:39:14	1.7
--- classes.exp	2001/07/03 01:56:31
*************** proc test_ptype_class_objects {} {
*** 224,230 ****
      # it to print as "struct".
      send_gdb "ptype class A\n"
      gdb_expect {
! 	-re "type = (class|struct) A \{(${ws}public:|)${ws}int a;${ws}int x;((${ws}A & operator=\\(A const ?&\\);)|(${ws}A\\(A const ?&\\);)|(${ws}A\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class A"
  	}
  	-re ".*$gdb_prompt $" {
--- 224,230 ----
      # it to print as "struct".
      send_gdb "ptype class A\n"
      gdb_expect {
! 	-re "type = (class|struct) A \{(${ws}public:|)${ws}int a;${ws}int x;((${ws}A & operator=\\(A const ?&\\);)|(${ws}A\\(A const ?&\\);)|(${ws}A\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class A"
  	}
  	-re ".*$gdb_prompt $" {
*************** proc test_ptype_class_objects {} {
*** 242,248 ****
  	-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\\);${ws}\}$nl$gdb_prompt $" {
  	    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\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class B (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
--- 242,248 ----
  	-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\\);${ws}\}$nl$gdb_prompt $" {
  	    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|)\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class B (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
*************** proc test_ptype_class_objects {} {
*** 260,266 ****
  	-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\\);${ws}\}$nl$gdb_prompt $" {
  	    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\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class C (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
--- 260,266 ----
  	-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\\);${ws}\}$nl$gdb_prompt $" {
  	    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|)\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class C (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
*************** proc test_ptype_class_objects {} {
*** 278,284 ****
  	-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\\);${ws}\}$nl$gdb_prompt $" {
  	    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\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class D (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
--- 278,284 ----
  	-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\\);${ws}\}$nl$gdb_prompt $" {
  	    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|)\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class D (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
*************** proc test_ptype_class_objects {} {
*** 296,302 ****
  	-re "type = class E : public D \{${ws}public:${ws}int e;${ws}int x;${ws}E & operator=\\(E const &\\);${ws}E\\(E const &\\);${ws}E\\(void\\);${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class E"
  	}
! 	-re "type = class E : public D \{${ws}public:${ws}int e;${ws}int x;((${ws}E & operator=\\(E const &\\);)|(${ws}E\\(E const &\\);)|(${ws}E\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class E"
  	}
  	-re ".*$gdb_prompt $" {
--- 296,302 ----
  	-re "type = class E : public D \{${ws}public:${ws}int e;${ws}int x;${ws}E & operator=\\(E const &\\);${ws}E\\(E const &\\);${ws}E\\(void\\);${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class E"
  	}
! 	-re "type = class E : public D \{${ws}public:${ws}int e;${ws}int x;((${ws}E & operator=\\(E const ?&\\);)|(${ws}E\\(E const ?&\\);)|(${ws}E\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class E"
  	}
  	-re ".*$gdb_prompt $" {
*************** proc test_ptype_class_objects {} {
*** 313,319 ****
  	-re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;${ws}vA & operator=\\(vA const &\\);${ws}vA\\(vA const &\\);${ws}vA\\(void\\);${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class vA"
  	}
! 	-re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;((${ws}vA & operator=\\(vA const &\\);)|(${ws}vA\\(vA const &\\);)|(${ws}vA\\(void\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class vA (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
--- 313,319 ----
  	-re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;${ws}vA & operator=\\(vA const &\\);${ws}vA\\(vA const &\\);${ws}vA\\(void\\);${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class vA"
  	}
! 	-re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;((${ws}vA & operator=\\(vA const ?&\\);)|(${ws}vA\\(vA const ?&\\);)|(${ws}vA\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class vA (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
*************** proc test_ptype_class_objects {} {
*** 342,348 ****
          -re "type = class vB : public virtual vA \{${ws}public:${ws}int vb;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
              pass "ptype class vB (aCC)"
          }
! 	-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\\);))*${ws}\}$nl$gdb_prompt $" {
  	    setup_xfail "*-*-*"
  	    fail "ptype class vB (FIXME) (obsolescent gcc or gdb)"
  	}
--- 342,348 ----
          -re "type = class vB : public virtual vA \{${ws}public:${ws}int vb;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
              pass "ptype class vB (aCC)"
          }
! 	-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\\(vB const ?&\\);)|(${ws}vB\\(int\\);)|(${ws}vB\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
  	    setup_xfail "*-*-*"
  	    fail "ptype class vB (FIXME) (obsolescent gcc or gdb)"
  	}
*************** proc test_ptype_class_objects {} {
*** 369,375 ****
          -re "type = class vC : public virtual vA \{${ws}public:${ws}int vc;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
              pass "ptype class vC (aCC)"
          }
! 	-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\\);))*${ws}\}$nl$gdb_prompt $" {
  	    setup_xfail "*-*-*"
  	    fail "ptype class vC (FIXME) (obsolescent gcc or gdb)"
  	}
--- 369,375 ----
          -re "type = class vC : public virtual vA \{${ws}public:${ws}int vc;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
              pass "ptype class vC (aCC)"
          }
! 	-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\\(vC const ?&\\);)|(${ws}vC\\(int\\);)|(${ws}vC\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
  	    setup_xfail "*-*-*"
  	    fail "ptype class vC (FIXME) (obsolescent gcc or gdb)"
  	}
*************** proc test_ptype_class_objects {} {
*** 396,402 ****
          -re "type = class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
              pass "ptype class vD (aCC)"
          }
! 	-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\\);))*${ws}\}$nl$gdb_prompt $" {
  	    setup_xfail "*-*-*"
  	    fail "ptype class vD (FIXME) (obsolescent gcc or gdb)"
  	}
--- 396,402 ----
          -re "type = class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
              pass "ptype class vD (aCC)"
          }
! 	-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\\(vD const ?&\\);)|(${ws}vD\\(int\\);)|(${ws}vD\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
  	    setup_xfail "*-*-*"
  	    fail "ptype class vD (FIXME) (obsolescent gcc or gdb)"
  	}
*************** proc test_ptype_class_objects {} {
*** 423,429 ****
          -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
              pass "ptype class vE (aCC)"
          }
! 	-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\\);))*${ws}\}$nl$gdb_prompt $" {
  	    setup_xfail "*-*-*"
  	    fail "ptype class vE (FIXME) (obsolescent gcc or gdb)"
  	}
--- 423,429 ----
          -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
              pass "ptype class vE (aCC)"
          }
! 	-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\\(vE const ?&\\);)|(${ws}vE\\(int\\);)|(${ws}vE\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
  	    setup_xfail "*-*-*"
  	    fail "ptype class vE (FIXME) (obsolescent gcc or gdb)"
  	}
*************** proc test_ptype_class_objects {} {
*** 442,448 ****
  	-re "type = class Base1 \{${ws}public:${ws}int x;${ws}Base1 & operator=\\(Base1 const &\\);${ws}Base1\\(Base1 const &\\);${ws}Base1\\(int\\);${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class Base1"
  	}
! 	-re "type = class Base1 \{${ws}public:${ws}int x;((${ws}Base1 & operator=\\(Base1 const &\\);)|(${ws}Base1\\(Base1 const &\\);)|(${ws}Base1\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class Base1 (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
--- 442,448 ----
  	-re "type = class Base1 \{${ws}public:${ws}int x;${ws}Base1 & operator=\\(Base1 const &\\);${ws}Base1\\(Base1 const &\\);${ws}Base1\\(int\\);${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class Base1"
  	}
! 	-re "type = class Base1 \{${ws}public:${ws}int x;((${ws}Base1 & operator=\\(Base1 const ?&\\);)|(${ws}Base1\\(Base1 const ?&\\);)|(${ws}Base1\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class Base1 (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
*************** proc test_ptype_class_objects {} {
*** 463,469 ****
  	-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\\);${ws}\}$nl$gdb_prompt $" {
  	    pass "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}int operator int\\(void\\);)|(${ws}int times\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class Foo (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
--- 463,469 ----
  	-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\\);${ws}\}$nl$gdb_prompt $" {
  	    pass "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}int operator int\\((void|)\\);)|(${ws}int times\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class Foo (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
*************** proc test_ptype_class_objects {} {
*** 481,487 ****
  	-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\\);${ws}\}$nl$gdb_prompt $" {
  	    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\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class Bar (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {
--- 481,487 ----
  	-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\\);${ws}\}$nl$gdb_prompt $" {
  	    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\\);))*${ws}\}$nl$gdb_prompt $" {
  	    pass "ptype class Bar (obsolescent gcc or gdb)"
  	}
  	-re ".*$gdb_prompt $" {

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