From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GGchEv4FJ2EVGgAAWB0awg (envelope-from ) for ; Wed, 25 Aug 2021 23:09:50 -0400 Received: by simark.ca (Postfix, from userid 112) id 3B7A81EE1B; Wed, 25 Aug 2021 23:09:50 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9A41C1EDF5 for ; Wed, 25 Aug 2021 23:09:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 313273858409 for ; Thu, 26 Aug 2021 03:09:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 313273858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629947389; bh=rT5HCZllKDqzyTlqSz+Vulp1NDUVxkaxGIxHzARICh4=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=oNrMfS6V6fFXLoz8Sf9kq+j/jIK4dRbtabJoJ+2vqEZQ8km9FxunoY/DXFc6UFhxu aoZdtYA4E/63UALChJAccCMFxoGB6LN+gN8xFJofuvO44xhyQKNz4iAHheqXOWI4ot FeQW1jcqJ9YIEKTJ/WJJwoQtlLFyUZHh2w/kHhes= 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> 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-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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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