From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 10FFF3835431 for ; Mon, 7 Jun 2021 12:34:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 10FFF3835431 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 07DA21FDA1 for ; Mon, 7 Jun 2021 12:34:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623069255; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=RvLdQpXnCBA0c5fjiVgFHMoQdV35hRjyPBCzg2HNtjE=; b=Ol4A+MD15DKjdCQEmp4kSTPfJLKP3muqI/N48Znad4xPEFlqK/zXOmlaW906DQ31OXYqDf yInCuYjvlu3yecoV0WLSLdMl6kzK2N+h/b7zwAOWJMfYkhF51wzCeM9HlGO8epUsQY3C0e qRe9HI92PxJu/P/tozZs9Irp66m8/W0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623069255; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=RvLdQpXnCBA0c5fjiVgFHMoQdV35hRjyPBCzg2HNtjE=; b=r23rQxQml3Qv+9M+3rE+0V3OaYtjNC3nSP2hnmH4xlGr6BFpFYD1Tq+iMZy6sJ0Dy1Ouc2 TmUtwTCulNLaeuBA== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id E09AF118DD for ; Mon, 7 Jun 2021 12:34:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623069255; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=RvLdQpXnCBA0c5fjiVgFHMoQdV35hRjyPBCzg2HNtjE=; b=Ol4A+MD15DKjdCQEmp4kSTPfJLKP3muqI/N48Znad4xPEFlqK/zXOmlaW906DQ31OXYqDf yInCuYjvlu3yecoV0WLSLdMl6kzK2N+h/b7zwAOWJMfYkhF51wzCeM9HlGO8epUsQY3C0e qRe9HI92PxJu/P/tozZs9Irp66m8/W0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623069255; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=RvLdQpXnCBA0c5fjiVgFHMoQdV35hRjyPBCzg2HNtjE=; b=r23rQxQml3Qv+9M+3rE+0V3OaYtjNC3nSP2hnmH4xlGr6BFpFYD1Tq+iMZy6sJ0Dy1Ouc2 TmUtwTCulNLaeuBA== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id YaawNUYSvmALfwAALh3uQQ (envelope-from ) for ; Mon, 07 Jun 2021 12:34:14 +0000 Date: Mon, 7 Jun 2021 14:34:13 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix info-types-c.exp Message-ID: <20210607123412.GA8452@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-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 07 Jun 2021 12:34:26 -0000 Hi, Recently, I've rewritten gdb.base/info-types.exp.tcl to do processing line-by-line (commit 2129a942553). When building gdb with -O0, this test passes for me, but with -O2 I sometimes run into: ... FAIL: gdb.base/info-types-c.exp: info types (state == 1) ... The output the failing gdb_test_multiple is trying to parse is: ... (gdb) info types^M All defined types:^M ^M File src/gdb/testsuite/gdb.base/info-types.c:^M 52: typedef enum {...} anon_enum_t;^M ... (gdb) ... and the FAIL with state == 1 means that: - the regexp for "All defined types:" did trigger, and that - the regexp for "File .*info-types.c" didn't trigger. This is due to the fact that the empty line inbetween is supposed to be matched by the "random line" regexp "^\r\n(\[^\r\n\]*)(?=\r\n)", which doesn't happen because instead the earlier regexp consuming the gdb prompt matches. Fix this by moving the "random line" regexp up. [ Note that that regexp does not consume the gdb prompt, because it requires (but doesn't consume) a terminating "\r\n". Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix info-types-c.exp gdb/testsuite/ChangeLog: 2021-06-07 Tom de Vries * gdb.base/info-types.exp.tcl (run_test): Move "random line" regexp up. --- gdb/testsuite/gdb.base/info-types.exp.tcl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.base/info-types.exp.tcl b/gdb/testsuite/gdb.base/info-types.exp.tcl index 2989751eef9..0eac3dbe67c 100644 --- a/gdb/testsuite/gdb.base/info-types.exp.tcl +++ b/gdb/testsuite/gdb.base/info-types.exp.tcl @@ -168,13 +168,6 @@ proc run_test { lang } { if { $state == 2 } { set state -4 } exp_continue } - -re -wrap "" { - if { $state == 3} { - pass $gdb_test_name - } else { - fail "$gdb_test_name (state == $state)" - } - } -re "^\r\n(\[^\r\n\]*)(?=\r\n)" { if { $state == 2 } { set line $expect_out(1,string) @@ -187,6 +180,13 @@ proc run_test { lang } { } exp_continue } + -re -wrap "" { + if { $state == 3} { + pass $gdb_test_name + } else { + fail "$gdb_test_name (state == $state)" + } + } } }