From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [RFC][gdb/testsuite] Add check-readmore
Date: Wed, 25 Aug 2021 23:09:15 -0400 [thread overview]
Message-ID: <5abb7e45-c1e1-b8f9-125c-334353a5396b@polymtl.ca> (raw)
In-Reply-To: <20210608072444.GA3547@delia>
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
next prev parent reply other threads:[~2021-08-26 3:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 7:24 Tom de Vries
2021-08-26 3:09 ` Simon Marchi via Gdb-patches [this message]
2021-08-30 15:30 ` Tom de Vries via Gdb-patches
2021-08-31 13:45 ` [PATCH][gdb/testsuite] " Tom de Vries via Gdb-patches
2021-10-09 16:54 ` Tom de Vries via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5abb7e45-c1e1-b8f9-125c-334353a5396b@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
--cc=tdevries@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox