From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12092 invoked by alias); 2 Jul 2003 15:39:26 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12075 invoked from network); 2 Jul 2003 15:39:26 -0000 Received: from unknown (HELO concert.shout.net) (204.253.184.25) by sources.redhat.com with SMTP; 2 Jul 2003 15:39:26 -0000 Received: from duracef.shout.net (duracef.shout.net [204.253.184.12]) by concert.shout.net (8.12.9/8.12.9) with ESMTP id h62FdOEb031899; Wed, 2 Jul 2003 10:39:24 -0500 Received: from duracef.shout.net (localhost [127.0.0.1]) by duracef.shout.net (8.12.9/8.12.9) with ESMTP id h62FdOHK025064; Wed, 2 Jul 2003 10:39:24 -0500 Received: (from mec@localhost) by duracef.shout.net (8.12.9/8.12.9/Submit) id h62FdJWR025063; Wed, 2 Jul 2003 11:39:19 -0400 Date: Wed, 02 Jul 2003 15:39:00 -0000 From: Michael Elizabeth Chastain Message-Id: <200307021539.h62FdJWR025063@duracef.shout.net> To: carlton@kealia.com, gdb-patches@sources.redhat.com Subject: [patch/testsuite] gdb.c++/classes.exp: add another ptype pattern X-SW-Source: 2003-07/txt/msg00029.txt.bz2 This patch adds a pattern to a ptype test in classes.exp. Here is the story. The class is: class ClassWithEnum { public: enum PrivEnum { red, green, blue, yellow = 42 }; PrivEnum priv_enum; int x; }; The ptype output depends on the compiler version and the debugging format. Here are all ten of them: # gcc 2.95.3 -gdwarf-2 # gcc 3.2.3 -gdwarf-2 # gcc 3.3 -gdwarf-2 # gcc gcc-3_3-branch -gdwarf-2 ptype obj_with_enum type = class ClassWithEnum { public: PrivEnum priv_enum; int x; } (gdb) KFAIL: gdb.c++/classes.exp: ptype obj_with_enum (PRMS: gdb/57) # gdb HEAD -gdwarf-2 ptype obj_with_enum No symbol "obj_with_enum" in current context. (gdb) FAIL: gdb.c++/classes.exp: ptype obj_with_enum # gcc 2.95.3 -gstabs+ # gcc 3.2.3 -gstabs+ ptype obj_with_enum type = class ClassWithEnum { public: PrivEnum priv_enum; int x; ClassWithEnum & operator=(ClassWithEnum const &); ClassWithEnum(ClassWithEnum const &); ClassWithEnum(void); } (gdb) KFAIL: gdb.c++/classes.exp: ptype obj_with_enum (PRMS: gdb/57) # gcc 3.3 -gstabs+ # gcc gcc-3_3-branch -gstabs+ # gcc HEAD -gstabs+ ptype obj_with_enum type = class ClassWithEnum { public: ClassWithEnum::PrivEnum priv_enum; int x; ClassWithEnum & operator=(ClassWithEnum const&); ClassWithEnum(ClassWithEnum const&); ClassWithEnum(); } (gdb) FAIL: gdb.c++/classes.exp: ptype obj_with_enum Grubbing through all these configurations fatigues the brain! So ... the configurations with KFAIL are cool. David C left a comment in the test script indicating that naked 'PrivEnum' is a symptomm of a gdb bug. The configuration gcc HEAD -gdwarf-2 points to a real bug which needs investigation. My concern is gcc 3.3 -gstabs+. gdb is printing the right output, but there is no arm in the test case for it, so it FAILed. This patch adds an arm so that this output will now PASS. Testing: tested on HEAD with all the compilers and debug formats shown, native i686-pc-linux-gnu. I will apply this tomorrow to HEAD if nobody has an objection, and backport it to gdb_6_0-branch some time after that. (This is item #2 on my three item list to fix all the places where gcc 3.3 has regressions versus gcc 3.2.3). Michael C 2003-07-02 Michael Chastain * gdb.c++/classes.exp (test_enums): Accept ptype output that shows compiler-generated functions. Index: classes.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/classes.exp,v retrieving revision 1.17 diff -u -r1.17 classes.exp --- classes.exp 3 Mar 2003 18:48:31 -0000 1.17 +++ classes.exp 2 Jul 2003 15:20:43 -0000 @@ -659,7 +659,12 @@ # ptype on the object send_gdb "ptype obj_with_enum\n" gdb_expect { - -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)ClassWithEnum::PrivEnum priv_enum;\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { pass "ptype obj_with_enum" } + -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)ClassWithEnum::PrivEnum priv_enum;\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { + pass "ptype obj_with_enum" + } + -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)ClassWithEnum::PrivEnum priv_enum;\r\n\[ \t\]*int x;\[\r\n\]+\[ \t\]*ClassWithEnum *& *operator *=\\(ClassWithEnum const *&\\);\r\n\[ \t\]*ClassWithEnum\\(ClassWithEnum const *&\\);\r\n\[ \t\]*ClassWithEnum\\( *\\);\r\n\\}\r\n$gdb_prompt $" { + pass "ptype obj_with_enum" + } -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)PrivEnum priv_enum;\r\n\[ \t\]*int x;.*\\}\r\n$gdb_prompt $" { # NOTE: carlton/2003-02-28: One could certainly argue that