From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12163 invoked by alias); 30 Dec 2003 21:15: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 12156 invoked from network); 30 Dec 2003 21:15:25 -0000 Received: from unknown (HELO mclean.mail.mindspring.net) (207.69.200.57) by sources.redhat.com with SMTP; 30 Dec 2003 21:15:25 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by mclean.mail.mindspring.net with esmtp (Exim 3.33 #1) id 1AbRCa-0005uo-00; Tue, 30 Dec 2003 16:14:56 -0500 Received: by berman.michael-chastain.com (Postfix, from userid 502) id E56374B35A; Tue, 30 Dec 2003 16:15:02 -0500 (EST) To: drow@mvista.com, gdb-patches@sources.redhat.com Subject: Re: [cplus] An initial use of the canonicalizer Message-Id: <20031230211502.E56374B35A@berman.michael-chastain.com> Date: Tue, 30 Dec 2003 21:15:00 -0000 From: mec.gnu@mindspring.com (Michael Elizabeth Chastain) X-SW-Source: 2003-12/txt/msg00523.txt.bz2 Uh, I don't like parts of this. - -re "type = (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char.* \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" } + -re "type = (class |)Foo<.*char.* ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char.* \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" } You dropped the "volatile" from the expected test pattern. Can you do something like: (volatile char ?*|char volatile ?*) - -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo \\*(| const), int, .*char \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo::foo" } + -re "\\$\[0-9\]* = \\{.*char.* \\*\\((class |)Foo \\*(| const), int, .*char.* \\*\\)\\} $hex ::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo::foo" } This is okay. The old version is gross with ".*char" so the new version is no worse. +# Verify that we get the same results for Foo for some equivalent +# template arguments. +gdb_test "ptype Foo::x" "type = int \\( Foo<.*char.*\\*>::&\\)" +gdb_test "ptype Foo::x" "type = int \\( Foo<.*char.*\\*>::&\\)" +gdb_test "ptype Foo::x" "type = int \\( Foo<.*char.*\\*>::&\\)" I really want to see "volatile" in there. - -re "ptype Bar\r\ntype = class Bar {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);\r\n}\r\n$gdb_prompt $" + -re "ptype Bar\r\ntype = class Bar {\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int bar\\(int, int\\);\r\n}\r\n$gdb_prompt $" Please do this with "" instead of "". Here is why: sometimes, I need to run the current test suite with gdb 6.0, because the 6.0 test suite no longer works with the current compiler. So it helps me a lot if the current test suite accepts the output of both gdb 6.0 and gdb HEAD. Sometimes this is painful but in cases like this it's easy and cheap. Michael C