From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30712 invoked by alias); 3 May 2011 16:53:40 -0000 Received: (qmail 30681 invoked by uid 22791); 3 May 2011 16:53:36 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Tue, 03 May 2011 16:53:16 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p43Gr7Cu004331 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 May 2011 12:53:07 -0400 Received: from dhcp-25-89.brq.redhat.com (pdp-11.brq.redhat.com [10.34.24.63]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p43Gr5Ju021799; Tue, 3 May 2011 12:53:06 -0400 Message-ID: <4DC032F1.3030705@redhat.com> Date: Tue, 03 May 2011 16:53:00 -0000 From: Marek Polacek User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100827 Red Hat Thunderbird/3.1.3 MIME-Version: 1.0 To: Pedro Alves CC: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb.base/pr10179.exp: fix racy tests (PR testsuite/12649) References: <4DBEE73B.3040202@redhat.com> <201105022024.01156.pedro@codesourcery.com> In-Reply-To: <201105022024.01156.pedro@codesourcery.com> Content-Type: text/plain; charset=UTF-8 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: 2011-05/txt/msg00067.txt.bz2 On 05/02/2011 09:24 PM, Pedro Alves wrote: > Please, can you try again, with some explanation of _why_ is > it needed to ... You are right, I'm sorry. Thus, here is another try. > For instance, break.exp doesn't appear to > need to match the whole question. In break.exp, there are no `gdb_test "delete breakpoints"'. > Not sure the original PR 10179 had something to do with > deleting breakpoints, otherwise, there's a delete_breakpoints > procedure tests can use to do this. I think the best thing here is to make use of the `delete_breakpoints', since pr10179.exp addresses to test the `rbreak', not deleting the breakpoints. Replacing `gdb_test "delete breakpoints"' with delete_breakpoints also cures the races. IIUC, the race was caused by this part: "Delete all breakpoints.*" "y" Thus, when using read1(), we match the question "Delete all breakpoints? (y or n)" right after the "breakpoints" word. This will leave in the buffer "? (y or n)". The "(y or n)" matches and causes the "interactive prompt" fail. Here is a better patch. Tested with both read{,1}. OK now? Thanks, 2011-05-03 Marek Polacek * gdb.base/pr10179.exp: Get rid of races using `delete_breakpoints' in place of `gdb_test "delete breakpoints"'. This eliminates two testcases. Index: pr10179.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/pr10179.exp,v retrieving revision 1.2 diff -u -r1.2 pr10179.exp --- pr10179.exp 1 Jan 2011 15:33:42 -0000 1.2 +++ pr10179.exp 3 May 2011 16:46:27 -0000 @@ -29,10 +29,10 @@ gdb_test "rbreak foo.*" "Breakpoint \[0-9\]+\[^\\n\]*\\nint foo\[12\]\[^\\n\]*\\nBreakpoint \[0-9\]+\[^\\n\]*\\nint foo\[12\].*" -gdb_test "delete breakpoints" ".*" "" "Delete all breakpoints.*" "y" +delete_breakpoints gdb_test "rbreak pr10179-a.c:foo.*" "Breakpoint \[0-9\]+\[^\\n\]*\\nint foo.*" -gdb_test "delete breakpoints" ".*" "" "Delete all breakpoints.*" "y" +delete_breakpoints gdb_test "rbreak pr10179-a.c : .*" "Breakpoint \[0-9\]+\[^\\n\]*\\nint bar1\[^\\n\]*\\nBreakpoint \[0-9\]+\[^\\n\]*\\nint foo1\[^\\n\]*\\nBreakpoint \[0-9\]+\[^\\n\]*\\nint main\[^\\n\]*.*"