From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 1A9743858D34 for ; Thu, 26 Aug 2021 03:09:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1A9743858D34 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 17Q39FXD003837 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Aug 2021 23:09:20 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 17Q39FXD003837 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 826AB1EDF5; Wed, 25 Aug 2021 23:09:15 -0400 (EDT) Subject: Re: [RFC][gdb/testsuite] Add check-readmore To: Tom de Vries , gdb-patches@sourceware.org References: <20210608072444.GA3547@delia> From: Simon Marchi Message-ID: <5abb7e45-c1e1-b8f9-125c-334353a5396b@polymtl.ca> Date: Wed, 25 Aug 2021 23:09:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210608072444.GA3547@delia> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 26 Aug 2021 03:09:15 +0000 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2021 03:09:31 -0000 On 2021-06-08 3:24 a.m., Tom de Vries wrote: > Hi, > > Consider the gdb output: > ... > 27 return SYSCALL_CANCEL (nanosleep, requested_time, remaining);^M > (gdb) ^M > Thread 2 "run-attach-whil" stopped.^M > ... > > When trying to match the gdb prompt using gdb_test which uses '$gdb_prompt $', > it may pass or fail. > > This sort of thing needs to be fixed (see commit b0e2f96b56b), but there's > currently no way to reliably find this type of FAILs. > > We have check-read1, but that one actually make the test pass reliably. > > We need something like the opposite of check-read1: something that makes > expect read a bit slower, or more exhaustively. > > Add a new test target check-readmore that implements this. > > Atm there are still two methods of implementing this in read1.c: > - the first method waits a bit before doing a read > - the second method does a read and then decides whether to > return or to wait a bit and do another read. > > Atm the first method is enabled by default, given that it is more foolproof. > The second method tries to be smart about waiting less than the first method, > but consequently needs to make decisions about error codes, which is more > fragile. > > Tested on x86_64-linux, both with method 1 and 2. > > Any comments? Is there an advantage to method 2 over method 1? If not, I'd just go with the simplest. I could imagine a modified method 2 version where we read in a loop though, until we reached "count" bytes or the file descriptor has no more data to offer (still with a 10ms wait between each read, to give the writer time to produce more data). Simon