From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14210 invoked by alias); 24 Jan 2004 07:27:18 -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 14199 invoked from network); 24 Jan 2004 07:27:17 -0000 Received: from unknown (HELO smtp6.mindspring.com) (207.69.200.110) by sources.redhat.com with SMTP; 24 Jan 2004 07:27:17 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by smtp6.mindspring.com with esmtp (Exim 3.33 #1) id 1AkICK-0000EY-00 for gdb-patches@sources.redhat.com; Sat, 24 Jan 2004 02:27:16 -0500 Received: by berman.michael-chastain.com (Postfix, from userid 502) id E57694B363; Sat, 24 Jan 2004 02:27:16 -0500 (EST) To: gdb-patches@sources.redhat.com Subject: [patch/cp/testsuite] local.exp: update "ptype Local", is now "ptype l" Message-Id: <20040124072716.E57694B363@berman.michael-chastain.com> Date: Sat, 24 Jan 2004 07:27:00 -0000 From: mec.gnu@mindspring.com (Michael Elizabeth Chastain) X-SW-Source: 2004-01/txt/msg00644.txt.bz2 [Sorry David C, I sent this to "redha.com" the first time.] This patch updates the "ptype Local" test in gdb.cp/local.exp. First, I changed the test from "ptype Local" (a type) to "ptype l" (a variable of that type). This gives more informative test output when gdb says that the type of "l" is "Foobar__fi.0::Local". "ptype Local" just complains about a nonexistent type, but "ptype l" outputs something specific that I can KFAIL on. Next, I ran the "ptype l" through a test matrix with 12 configurations: gdb 6.0, gdb HEAD gcc 2.95.3, gcc 3.3.2, gcc HEAD gdwarf-2, -gstabs+ I looked at all the output and wrote nice patterns for all of them. There are three arms with two KFAIL's, gdb/1516 and gdb/483. The comments in the test suite explain the bad output that triggers the KFAIL's. Basically, gdb/1516 is for "Foobar__Fi.0::Local", and gdb/483 is for duplication of "char loc_foo(char)". Also, with gcc 2.95.3 -gstabs+, the pesky "Foobar__Fi.0::Local" pops up in a different place8: inside the arguments of the synthetic copy ctor and the synthetic assignment operator. This happens with both gdb 6.0 and gdb HEAD, so it's not a regression. The old script accepted those, but I KFAIL'ed them to gdb/1516 as well. I am going to wait 24 hours for comments, and then commit this if there are no issues. Also, overall, I really like my new way of writing these tests, with re_class, re_fields, re_methods, re_synth. The new code is clear to me. But I dunno if it's clear to other people or just to me. Thoughts? Michael C 2004-01-23 Michael Chastain * gdb.cp/local.exp: Change "ptype Local" to "ptype l". Provide arms for current output in all my configurations. Index: local.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/local.exp,v retrieving revision 1.3 diff -c -3 -p -r1.3 local.exp *** local.exp 19 Jan 2004 04:06:42 -0000 1.3 --- local.exp 24 Jan 2004 07:10:41 -0000 *************** if ![runto 'marker1'] then { *** 73,125 **** gdb_test "up" ".*foobar.*" "up from marker1" ! # Local classes in g++ get names like "main.1::InnerLocal", just like local ! # static variables. Some targets use "___" instead of ".". ! # --- ! # Pattern 1: ! # PASS ! # dwarf-2 ! # gcc 2.95.3 # ! # Pattern 2: ! # FAIL ! # This has a duplicate "char loc_foo" line. This is a bug. ! # Historically this has been an XFAIL. ! # dwarf-2 ! # gcc 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD # ! # Pattern 3: ! # PASS ! # stabs+ ! # gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD # ! # Pattern 4: ! # This an old pattern from the hppa aCC version of this file. ! # I left it alone. # ! # chastain 2002-04-08 ! # pattern #5 ! # PASS ! # stabs+ ! # gcc HEAD abi-2 ! # ! # chastain 2004-01-02 ! set sep "(\[.\]|___)\[0-9\]" ! send_gdb "ptype Local\n" ! gdb_expect { ! -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" } ! -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*\}.*$gdb_prompt $" { ! kfail "gdb/483" "ptype Local" ! } ! -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*Local & operator *=\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((void|)\\);\[\r\n\t \]*char loc_foo\\(char\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" } ! -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*char loc_foo\\(char\\);\r\n\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\)\r\n\}.*$gdb_prompt $" { xpass "ptype Local (old aCC)" } ! -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\(char\\);\[\r\n\t \]*Local & operator *=\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((void|)\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" } ! -re ".*$gdb_prompt $" { fail "ptype Local" } ! timeout { fail "(timeout) ptype Local" } } gdb_test "break marker2" --- 73,137 ---- gdb_test "up" ".*foobar.*" "up from marker1" ! set sep "(\[.\]|___)\[0-9\]" ! # ptype on a local variable. # ! # This test has six arms. The first three arms accept normal output: ! # no synthetic methods; synthetic methods before user methods; ! # synthetic methods after user methods. # ! # The next two arms accept "foobar__Fi.0::Local" instead of "Local". ! # This is a bug. It happens in various places with various versions of ! # gcc and gdb and various debugging types. # ! # The last arm accepts the user methods in duplicate. This bug happens ! # with gcc 3.3.2 -gdwarf-2, and has been fixed in gcc HEAD 2004-01-22. # ! # -- chastain 2004-01-24 ! set re_class "((struct|class) Local \{${ws}public:|struct Local \{)" ! set re_fields "int loc1;" ! set re_methods "char loc_foo\\(char\\);" ! set re_synth_gcc_23 "Local & operator=\\(Local const ?&\\);${ws}Local\\(Local const ?&\\);${ws}Local\\((void|)\\);" ! set XX_class "((struct|class) foobar__Fi.0::Local \{${ws}public:|struct foobar__Fi.0:Local \{)" ! set XX_synth_gcc_2 "Local & operator=\\(foobar__Fi.0::Local const ?&\\);${ws}Local\\(foobar__Fi.0::Local const ?&\\);${ws}Local\\((void|)\\);" ! set YY_methods "$re_methods${ws}$re_methods" ! set name "ptype l" ! gdb_test_multiple "ptype l" "ptype l" { ! -re "type = $re_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" { ! # gdb 6.0, gcc 2.95.3, dwarf-2 ! # gdb 6.0, gcc HEAD 2004-01-22, dwarf-2 ! # gdb HEAD 2004-01-23, gcc HEAD 2004-01-22, dwarf-2 ! # gdb HEAD 2004-01-23, gcc HEAD 2004-01,22, dwarf-2 ! pass "$name" ! } ! -re "type = $re_class${ws}$re_fields${ws}$re_synth_gcc_23${ws}$re_methods$nl\}$nl$gdb_prompt $" { ! # gdb 6.0, gcc 3.3.2, stabs+ ! # gdb HEAD 2004-01-23, gcc 3.3.2, stabs+ ! pass "$name" ! } ! -re "type = $re_class${ws}$re_fields${ws}$re_methods${ws}$re_synth_gcc_23${ws}$nl\}$nl$gdb_prompt $" { ! # gdb 6.0, gcc HEAD 2004-01-22, stabs+ ! # gdb HEAD 2004-01-23, gcc HEAD 2004-01-22, stabs+ ! pass "$name" ! } ! -re "type = $XX_class${ws}$re_fields${ws}$re_methods$nl\}$nl$gdb_prompt $" { ! # gdb HEAD 2004-01-23, gcc 2.95.3, dwarf-2 ! kfail "gdb/1516" "$name" ! } ! -re "type = ($re_class|$XX_class)${ws}$re_fields${ws}($re_synth_gcc_23|$XX_synth_gcc_2)${ws}$re_methods$nl\}$nl$gdb_prompt $" { ! # gdb 6.0, gcc 2.95.3, stabs+ ! # gdb HEAD 2004-01-23, gcc 2.95.3, stabs+ ! kfail "gdb/1516" "$name" ! } ! -re "type = ($re_class|$XX_class)${ws}$re_fields${ws}$YY_methods$nl\}$nl$gdb_prompt $" { ! # gdb 6.0, gcc 3.3.2, dwarf-2 ! # gdb HEAD 2004-01-23, gcc 3.2.2, dwarf-2 ! kfail "gdb/483" "$name" ! } } gdb_test "break marker2"