Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: V3 fixes for classes.exp
@ 2001-07-03  9:28 Michael Elizabeth Chastain
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Elizabeth Chastain @ 2001-07-03  9:28 UTC (permalink / raw)
  To: jimb, msnyder; +Cc: chastain, gdb-patches

* Make the "void" optional in constructors with no params

At first, I thought that MichaelS was talking about the "void" return
type that gdb is showing for constructors.  This is bogus and the test
suite is correct when it FAILs this output.

But when I actually read the patch, I saw that he was talking about
parameter types for functions that have no params:

  - \\(void\\)
  + \\((void|)\\)

With v2 g++, I see a lot of "foo(void)".   With v3 g++, these show
up as "foo()".

I think these changes are fine.

I haven't reviewed and tested the whole patch yet so I can't
recommend it yet.

History note: in the beginning, there were a lot of C header files with
declarations like "foo()", with no parameters (to be compatible with K&R
C).  Ansi C and C++ wanted to glom onto those header files, so they had
to adopt the convention that "foo()" declares a function with unspecified
parameters, whereas "foo(void)" declares a function with zero parameters.

C++ is abandoning K&R C, so the C++ convention is that "foo()" declares
a function with zero parameters.  So header files from 1985 don't work
anymore.

This history gets reflected in the demangler output.  So we have to cope
with both "foo(void)" and "foo()", depending on the compiler.  This is
easy to do when parsing output.  It requires more work when the test
script is providing input (such as breaking on either "foo(void)" or
"foo()".

MichaelC


^ permalink raw reply	[flat|nested] 4+ messages in thread
* V3 fixes for classes.exp
@ 2001-07-02 19:02 Michael Snyder
  2001-07-03  8:48 ` Jim Blandy
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2001-07-02 19:02 UTC (permalink / raw)
  To: jimb, chastain, gdb-patches

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 $" {
From geoffk@geoffk.org Mon Jul 02 23:25:00 2001
From: Geoff Keating <geoffk@geoffk.org>
To: jjohnstn@cygnus.com (J. Johnston)
Cc: gcc-patches@gcc.gnu.org
Subject: Re: Libiberty regex support - revised patch
Date: Mon, 02 Jul 2001 23:25:00 -0000
Message-id: <jm8zi6345q.fsf@geoffk.org>
References: <3B3BB266.551EDBCD.cygnus.local.cgen@cygnus.com>
X-SW-Source: 2001-07/msg00027.html
Content-length: 107

This patch is OK for GCC, if it hasn't been approved already.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-07-03 12:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-03  9:28 V3 fixes for classes.exp Michael Elizabeth Chastain
  -- strict thread matches above, loose matches on Subject: below --
2001-07-02 19:02 Michael Snyder
2001-07-03  8:48 ` Jim Blandy
2001-07-03 12:36   ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox