From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18748 invoked by alias); 2 Dec 2016 17:48:23 -0000 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 Received: (qmail 18724 invoked by uid 89); 2 Dec 2016 17:48:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=racy X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Dec 2016 17:48:19 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 157C969CAE; Fri, 2 Dec 2016 17:48:11 +0000 (UTC) Received: from [127.0.0.1] (ovpn03.gateway.prod.ext.phx2.redhat.com [10.5.9.3]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uB2Hm9VI023946; Fri, 2 Dec 2016 12:48:10 -0500 Subject: Re: [PATCH] Remove unneeded pattern matching in gdb.base/maint.exp To: Luis Machado , gdb-patches@sourceware.org References: <1480698345-9779-1-git-send-email-lgustavo@codesourcery.com> <7413a597-6c53-78ac-1426-d723742db408@codesourcery.com> From: Pedro Alves Message-ID: <4906c887-a561-be85-d918-34050f240d6d@redhat.com> Date: Fri, 02 Dec 2016 17:48:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <7413a597-6c53-78ac-1426-d723742db408@codesourcery.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-12/txt/msg00108.txt.bz2 On 12/02/2016 05:40 PM, Luis Machado wrote: > Doesn't gdb_test_multiple already check for a trailing $gdb_prompt? gdb_test does, but gdb_test_multiple does not. What gdb_test_multiple has, is an internal pattern that matches the prompt if no other user-specified pattern matches: -re "\r\n$gdb_prompt $" { if ![string match "" $message] then { fail "$message" } set result 1 } That's why the second regexp here: gdb_test_multiple "...." "...." { -re "some pattern $gdb_prompt $ { } -re ".*$gdb_prompt $ { fail "...." } } ... is unnecessary. But the gdb_prompt match in the first regexp is absolutely necessary, otherwise you leave it dangling in the expect buffer and confuse whatever comes after. Whether that causes trouble or not in a given dejagnu invocation is racy, depends on how much expect pulls in to its internal buffer at a time. Often, "make check-read1" will make such problems more reproducible. But just don't introduce the problem in the first place, please. :-) Thanks, Pedro Alves