From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2968 invoked by alias); 16 Jun 2010 08:12:41 -0000 Received: (qmail 2959 invoked by uid 22791); 16 Jun 2010 08:12:40 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM X-Spam-Check-By: sourceware.org Received: from mail-ww0-f41.google.com (HELO mail-ww0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Jun 2010 08:12:33 +0000 Received: by wwb34 with SMTP id 34so5892307wwb.0 for ; Wed, 16 Jun 2010 01:12:24 -0700 (PDT) Received: by 10.216.186.5 with SMTP id v5mr323935wem.51.1276675944155; Wed, 16 Jun 2010 01:12:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.167.144 with HTTP; Wed, 16 Jun 2010 01:12:04 -0700 (PDT) In-Reply-To: <20100615161912.GA7975@caradoc.them.org> References: <4BF59BBB.8020603@vmware.com> <20100615161912.GA7975@caradoc.them.org> From: Frederic Riss Date: Wed, 16 Jun 2010 08:12:00 -0000 Message-ID: Subject: Re: [resubmit] gdb.base, r*.exp thru w*.exp To: Frederic Riss , Michael Snyder , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00361.txt.bz2 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. =A0You can't do the same with gdb_test_multiple, because it has > patterns like ".*$gdb_prompt $" -> FAIL. =A0If 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=3D\"\(.*\)\"\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=3D\"all\"\r\n)?$mi_gdb_p= rompt" { testsuite/gdb.mi/mi2-return.exp 56: gdb_test_multiple "111-exec-return" "return from callee4 now" { 57- -re "111\\^done,frame=3D\{level=3D\"0\",addr=3D\"$hex\",func=3D\"callee= 3\",args=3D\\\[.*\\\],file=3D\".*basics.c\",fullname=3D\"${fullname_syntax}= ${srcfile}\",line=3D\"($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=3D\"\(.*\)\"\r\n$mi_gdb_prompt" { testsuite/gdb.mi/mi-nonstop-exit.exp 40:gdb_test_multiple "-gdb-show non-stop" "" { 41- -re ".*\\^done,value=3D\"off\",supported=3D\"(\[^\"\]+)\"\r\n$mi_gdb= _prompt$" { testsuite/gdb.mi/mi-nonstop.exp 50:gdb_test_multiple "-gdb-show non-stop" "" { 51- -re ".*\\^done,value=3D\"off\",supported=3D\"(\[^\"\]+)\"\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=3D\"3\"\r\n\\*running,thread-id=3D\"2\"= \r\n\\*running,thread-id=3D\"1\"\r\n$mi_gdb_prompt" { testsuite/gdb.mi/mi-nsintrall.exp 40:gdb_test_multiple "-gdb-show non-stop" "" { 41- -re ".*\\^done,value=3D\"off\",supported=3D\"(\[^\"\]+)\"\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=3D\"off\",supported=3D\"(\[^\"\]+)\"\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=3D\"off\",supported=3D\"(\[^\"\]+)\"\r\n$mi_gdb= _prompt$" { testsuite/gdb.mi/mi-nsthrexec.exp 50:gdb_test_multiple "-gdb-show non-stop" "" { 51- -re ".*\\^done,value=3D\"off\",supported=3D\"(\[^\"\]+)\"\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=3D\{level=3D\"0\",addr=3D\"$hex\",func=3D\"callee= 3\",args=3D\\\[.*\\\],file=3D\".*basics.c\",fullname=3D\"${fullname_syntax}= ${srcfile}\",line=3D\"($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