From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gLcjHaVGbmLwnAMAWB0awg (envelope-from ) for ; Sun, 01 May 2022 04:36:53 -0400 Received: by simark.ca (Postfix, from userid 112) id 707951E058; Sun, 1 May 2022 04:36:53 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=G5DY/nsX; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.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 EA7761E00E for ; Sun, 1 May 2022 04:36:52 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 22030385803E for ; Sun, 1 May 2022 08:36:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22030385803E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651394212; bh=RfgQcWPl7OI8TqnwSOOU6UGyFXBjw90+qOrHGnhIl6A=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=G5DY/nsXwupc5Wf4kO7KfrZB6qqfl71Rke1782bzrx9kUmczKj4yStwLBXBeQQD2p gkcU20PgQRkPbRS2/7g5KKiV6J4JwVmo7f2bTwdvy7WWTRnW4pmgPQev2xYO/+zKtP 5m5bSB4AKd+q80FdxO1/JFSz5/7nePJlR+5/5gXI= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 0D99A3858D28 for ; Sun, 1 May 2022 08:36:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0D99A3858D28 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 20DE021874; Sun, 1 May 2022 08:36:30 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 082F613AE0; Sun, 1 May 2022 08:36:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 3+bCAI5GbmJYfwAAMHmgww (envelope-from ); Sun, 01 May 2022 08:36:30 +0000 Date: Sun, 1 May 2022 10:36:28 +0200 To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with check-readmore Message-ID: <20220501083627.GA8512@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, When running test-case gdb.threads/fork-plus-threads.exp with check-readmore, I run into: ... [Inferior 11 (process 7029) exited normally]^M [Inferior 1 (process 6956) exited normally]^M FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: \ inferior 1 exited (timeout) ... The problem is that the regexp consuming the "Inferior exited normally" messages: - consumes more than one of those messages at a time, but - counts only one of those messages. Fix this by adopting a line-by-line approach, which deals with those messages one at a time. Tested on x86_64-linux with native, check-read1 and check-readmore. Any comments? Thanks, - Tom [gdb/testsuite] Fix gdb.threads/fork-plus-threads.exp with check-readmore --- gdb/testsuite/gdb.threads/fork-plus-threads.exp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/gdb/testsuite/gdb.threads/fork-plus-threads.exp b/gdb/testsuite/gdb.threads/fork-plus-threads.exp index 26fbef72941..c05ac4a5a03 100644 --- a/gdb/testsuite/gdb.threads/fork-plus-threads.exp +++ b/gdb/testsuite/gdb.threads/fork-plus-threads.exp @@ -88,23 +88,15 @@ proc do_test { detach-on-fork } { set test "inferior 1 exited" gdb_test_multiple "" $test { - -re "Cannot remove breakpoints" { + -re "^Cannot remove breakpoints" { set saw_cannot_remove_breakpoints 1 exp_continue } - -re "Thread \[^\r\n\]+ stopped\\." { + -re "^\\\[Thread \[^\r\n\]+ stopped\\." { set saw_thread_stopped 1 exp_continue } - -re "(Thread|LWP) \[^\r\n\]+ exited" { - # Avoid timeout with check-read1 - exp_continue - } - -re "New (Thread|LWP) \[^\r\n\]+" { - # Avoid timeout with check-read1 - exp_continue - } - -re "Inferior ($::decimal) \(\[^\r\n\]+\) exited normally" { + -re "^\\\[Inferior ($::decimal) \(\[^\r\n\]+\) exited normally\\\]" { set infnum $expect_out(1,string) incr num_inferior_exits_seen incr inferior_exits_seen($infnum) 1 @@ -115,6 +107,10 @@ proc do_test { detach-on-fork } { exp_continue } } + -re "^\[^\r\n]*\r\n" { + # Skip line. + exp_continue + } } # Verify that we got all the inferior exits we expected.