From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1115 invoked by alias); 29 Oct 2011 10:09:22 -0000 Received: (qmail 1107 invoked by uid 22791); 29 Oct 2011 10:09:21 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_TM X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 29 Oct 2011 10:09:04 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9TA945X005528 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 29 Oct 2011 06:09:04 -0400 Received: from host1.jankratochvil.net (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9TA92xH003326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 29 Oct 2011 06:09:03 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p9TA91JF026331; Sat, 29 Oct 2011 12:09:01 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p9TA91j2026329; Sat, 29 Oct 2011 12:09:01 +0200 Date: Sat, 29 Oct 2011 10:36:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org, Marek Polacek Subject: [patch] testsuite: MI: racy results in async mode #2 Message-ID: <20111029100900.GA5767@host1.jankratochvil.net> References: <20111027101544.GA5288@host1.jankratochvil.net> <20111028083256.GA8281@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111028083256.GA8281@host1.jankratochvil.net> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-10/txt/msg00798.txt.bz2 On Fri, 28 Oct 2011 10:32:56 +0200, Jan Kratochvil wrote: > > Jan> 2011-10-27 Jan Kratochvil > > Jan> * lib/mi-support.exp (breakpoint_re): Suppress match reporting. > > Jan> (mi_gdb_test): Import globals thread_selected_re > > Jan> and breakpoint_re. Expect them optionally at the regex start. [...] > Checked in: > http://sourceware.org/ml/gdb-cvs/2011-10/msg00202.html Unfortunately it still does not work (but it is no longer reproducible by the testsuite/12649 "read1" way). -*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x080485fd",func="main",args=[{name="argc",value="1"},{name="argv",value="0xffffd1e4"}],file="gdb/testsuite/gdb.mi/non-stop.c",fullname="gdb/testsuite/gdb.mi/non-stop.c",line="86"},thread-id="1",stopped-threads=["1"],core="5"^M +*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x080485fd",func="main",args=[{name="argc",value="1"},{name="argv",value="0xffffd1c4"}],file="gdb/testsuite/gdb.mi/non-stop.c",fullname="gdb/testsuite/gdb.mi/non-stop.c",line="86"},thread-id="1",stopped-threads=["1"],core="0"^M +=breakpoint-deleted,id="1"^M PASS: gdb.mi/mi-nonstop.exp: mi runto main Expecting: 222\^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr=".*",func="break_at_me",file=".*",fullname=".*",line=".*",times="0",original-location=".*"} Expecting: ^(222-break-insert break_at_me[^M ]+)?(222\^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr=".*",func="break_at_me",file=".*",fullname=".*",line=".*",times="0",original-location=".*"}[^M ]+[(]gdb[)] ^M [ ]*) 222-break-insert break_at_me^M -=breakpoint-deleted,id="1"^M 222^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x08048537",func="break_at_me",file="gdb/testsuite/gdb.mi/non-stop.c",fullname="gdb/testsuite/gdb.mi/non-stop.c",line="41",times="0",original-location="break_at_me"}^M (gdb) ^M -FAIL: gdb.mi/mi-nonstop.exp: breakpoint at marker +PASS: gdb.mi/mi-nonstop.exp: breakpoint at marker Therefore proposing the attached way. No regressions on {x86_64,x86_64-m32,i686}-fedora16pre-linux-gnu and with gdbserver. Thanks, Jan gdb/testsuite/ 2011-10-29 Jan Kratochvil Fix racy FAILs. * lib/mi-support.exp (mi_gdb_test): Replace thread_selected_re and breakpoint_re globals import by async. Set string_regex to .* for async. Remove the optional thread_selected_re and breakpoint_re globals expectations. --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -576,7 +576,7 @@ proc mi_gdb_test { args } { global verbose global mi_gdb_prompt global GDB expect_out - global inferior_exited_re thread_selected_re breakpoint_re + global inferior_exited_re async upvar timeout timeout set command [lindex $args 0] @@ -651,6 +651,11 @@ proc mi_gdb_test { args } { set tmt 60; } } + if {$async} { + # With $prompt_re "" there may come arbitrary asynchronous response + # from the previous command, before or after $string_regex. + set string_regex ".*" + } verbose -log "Expecting: ^($string_regex\[\r\n\]+)?($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)" gdb_expect $tmt { -re "\\*\\*\\* DOSEXIT code.*" { @@ -668,7 +673,7 @@ proc mi_gdb_test { args } { gdb_start set result -1 } - -re "^(?:$thread_selected_re|$breakpoint_re)*($string_regex\[\r\n\]+)?($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)" { + -re "^($string_regex\[\r\n\]+)?($pattern\[\r\n\]+$mi_gdb_prompt\[ \]*)" { # At this point, $expect_out(1,string) is the MI input command. # and $expect_out(2,string) is the MI output command. # If $expect_out(1,string) is "", then there was no MI input command here.