From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23122 invoked by alias); 18 Jun 2010 00:23:15 -0000 Received: (qmail 23103 invoked by uid 22791); 18 Jun 2010 00:23:14 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Jun 2010 00:23:09 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 315B923007; Thu, 17 Jun 2010 17:23:06 -0700 (PDT) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost4.vmware.com (Postfix) with ESMTP id 25D15C9A53; Thu, 17 Jun 2010 17:23:06 -0700 (PDT) Message-ID: <4C1ABC69.3050706@vmware.com> Date: Fri, 18 Jun 2010 00:23:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.22 (X11/20090609) MIME-Version: 1.0 To: Frederic Riss CC: "gdb-patches@sourceware.org" Subject: Re: [resubmit] gdb.base, r*.exp thru w*.exp References: <4BF59BBB.8020603@vmware.com> <20100615161912.GA7975@caradoc.them.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-06/txt/msg00390.txt.bz2 Frederic Riss wrote: > Hi, > > On 15 June 2010 18:19, Daniel Jacobowitz wrote: >> This hunk unfortunately exhibits a common subtle pitfall :-( >> >> You can use bare gdb_expect with a string that contains gdb_prompt not >> at the end, or contains more than one gdb_prompt, although it's a bit >> tricky. You can't do the same with gdb_test_multiple, because it has >> patterns like ".*$gdb_prompt $" -> FAIL. If the output comes out >> buffered in such a way that the prompt is written separately from the >> post-prompt text, this will match before GDB is done printing output. > > OK, I audited the testsuite for uses of gdb_prompt in the middle of > gdb_test_multiple patterns (well to be precise, I looked for such > usage in the first pattern of every gdb_test_multiple. I becomes > harder to grep for the following patterns). Here's the list of the > problematic places I've found, which include all the failures I've > seen: > > > testsuite/gdb.base/setshow.exp > 58:gdb_test_multiple "set annotate 2" "set annotate 2" { > 59- -re ".*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" { > -- > 64:gdb_test_multiple "show annotate" "show annotate 2" { > 65- -re ".*\032\032post-prompt.*Annotation_level is > 2..*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" { > -- > 71:gdb_test_multiple "info line 1" "annotation_level 2" { > 72- -re ".*\032\032post-prompt.*Line 1 of .* is at address .* but > contains no code.*:1:0:beg:0x.*\032\032pre-prompt.*$gdb_prompt > .*\032\032prompt.*$" { > > > testsuite/gdb.mi/mi2-basics.exp > 63: gdb_test_multiple "-gdb-version" "acceptance of MI operations" { > 64- -re "GNU gdb .*\r\n$mi_gdb_prompt$" { > -- > 212: gdb_test_multiple "-environment-path" "-environment-path" { > 213- -re "\\\^done,path=\"\(.*\)\"\r\n$mi_gdb_prompt" { > testsuite/gdb.mi/mi2-console.exp > 51:gdb_test_multiple "220-exec-next" "Started step over hello" { > 52- -re "220\\^running\r\n(\\*running,thread-id=\"all\"\r\n)?$mi_gdb_prompt" > { > > > testsuite/gdb.mi/mi2-return.exp > 56: gdb_test_multiple "111-exec-return" "return from callee4 now" { > 57- -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"($line_callee3_call|$line_callee3_close_brace)\"\}\r\n$mi_gdb_prompt$" > { > testsuite/gdb.mi/mi2-var-display.exp > 608:gdb_test_multiple "p/x \$fp" "print FP register" { > 609- -re ".*($hex).*\\^done\r\n$mi_gdb_prompt$" { > testsuite/gdb.mi/mi-basics.exp > 63: gdb_test_multiple "-gdb-version" "acceptance of MI operations" { > 64- -re "GNU gdb .*\r\n$mi_gdb_prompt$" { > -- > 210: gdb_test_multiple "-environment-path" "-environment-path" { > 211- -re "\\\^done,path=\"\(.*\)\"\r\n$mi_gdb_prompt" { > > > testsuite/gdb.mi/mi-nonstop-exit.exp > 40:gdb_test_multiple "-gdb-show non-stop" "" { > 41- -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" > { > > > testsuite/gdb.mi/mi-nonstop.exp > 50:gdb_test_multiple "-gdb-show non-stop" "" { > 51- -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" > { > -- > 96:gdb_test_multiple "-exec-interrupt --thread 1" "interrupted" { > 97- -re "\\^done\r\n$mi_gdb_prompt\\*stopped\[^\r\n\]+\r\n$" { > -- > 107:gdb_test_multiple "-exec-continue --all" "resume all" { > 108- -re ".*\\*running,thread-id=\"3\"\r\n\\*running,thread-id=\"2\"\r\n\\*running,thread-id=\"1\"\r\n$mi_gdb_prompt" > { > testsuite/gdb.mi/mi-nsintrall.exp > 40:gdb_test_multiple "-gdb-show non-stop" "" { > 41- -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" > { > -- > 80:gdb_test_multiple "-exec-continue --all" "resume all, no breakpoint" { > 81- -re ".*$running_re$mi_gdb_prompt" { > -- > 99:gdb_test_multiple "-exec-continue --all" "resume all after interrupting" { > 100- -re ".*$running_re$mi_gdb_prompt" { > > > testsuite/gdb.mi/mi-nsmoribund.exp > 40:gdb_test_multiple "-gdb-show non-stop" "" { > 41- -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" > { > -- > 101:gdb_test_multiple "-exec-continue --all" "resume all, thread > specific breakpoint" { > 102- -re ".*$running_re$mi_gdb_prompt" { > > > testsuite/gdb.mi/mi-ns-stale-regcache.exp > 54:gdb_test_multiple "-gdb-show non-stop" "" { > 55- -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" > { > > > testsuite/gdb.mi/mi-nsthrexec.exp > 50:gdb_test_multiple "-gdb-show non-stop" "" { > 51- -re ".*\\^done,value=\"off\",supported=\"(\[^\"\]+)\"\r\n$mi_gdb_prompt$" > { > > > testsuite/gdb.mi/mi-return.exp > 56: gdb_test_multiple "111-exec-return" "return from callee4 now" { > 57- -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"($line_callee3_call|$line_callee3_close_brace)\"\}\r\n$mi_gdb_prompt$" > { > testsuite/gdb.mi/mi-var-display.exp > 609:gdb_test_multiple "p/x \$fp" "print FP register" { > 610- -re ".*($hex).*\\^done\r\n$mi_gdb_prompt$" { > > > Note all the cases using mi_gdb_prompt. Even if the mi_gdb_prompt is > at the end of the pattern, as it expands to gdb_prompt followed by a > newline, it's as if we used gdb_prompt in the middle of the pattern. > I've definitely seen at least mi(2)-return.exp exhibit this random > failure. > > Cheers, > Fred Hmmm... I don't recall changing most of those. Are these all new failures?