From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 529C03858D28 for ; Fri, 31 Mar 2023 15:16:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 529C03858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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 6A29F21A96 for ; Fri, 31 Mar 2023 15:16:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1680275768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xhdoMSTRM7x/L40nEiLVTWGNbFAwp2Y8ZDruKCpW4mA=; b=EPLGjJyJSW0dJY9PKN1XhVNY4D+L7H/rw7wfhmntjh1Dc+fXs+WVlA5MyaGhw4eQh5xnsl 4hqZqDJ0aVs56XHHMbL/knDnbVYxwh2Ly2SlEfTAMfwv5dVjtUvrgJvofiMpGaEGsOYF8V Lg3JrWmEutjeww2iWmqlr3w3OcF334I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1680275768; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xhdoMSTRM7x/L40nEiLVTWGNbFAwp2Y8ZDruKCpW4mA=; b=fbtd21n2BRcVAyUDvwTfrYSRHlq8MHIDcu7/CDm7cjxbqoybsbOPOJ/2qfg032HF7EuWXg CyNtehAZNJOmIPDw== 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 55749133B6 for ; Fri, 31 Mar 2023 15:16:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1HycEzj5JmTEAwAAMHmgww (envelope-from ) for ; Fri, 31 Mar 2023 15:16:08 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed 1/2] [gdb/testsuite] Fix gdb.threads/threadapply.exp with editing off Date: Fri, 31 Mar 2023 17:15:52 +0200 Message-Id: <20230331151553.7938-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: With test-case gdb.threads/threadapply.exp and editing set to on, we have: ... (gdb) define remove^M Type commands for definition of "remove".^M End with a line saying just "end".^M >remove-inferiors 3^M >end^M (gdb) ... but with editing set to off, we run into: ... (gdb) define remove^M Type commands for definition of "remove".^M End with a line saying just "end".^M >remove-inferiors 3^M end^M >(gdb) FAIL: gdb.threads/threadapply.exp: thread_set=all: try remove: \ define remove (timeout) ... The commands are issued by this test: ... gdb_define_cmd "remove" { "remove-inferiors 3" } ... which does: - gdb_test_multiple "define remove", followed by - gdb_test_multiple "remove-inferiors 3\nend". Proc gdb_test_multiple has special handling for multi-line commands, which splits it up into subcommands, and for each subcommand issues it and then waits for the resulting prompt (the secondary prompt ">" for all but the last subcommand). However, that doesn't work as expected in this case because the initial gdb_test_multiple "define remove" fails to match all resulting output, and consequently the secondary prompt resulting from "define remove" is counted as if it was the one resulting from "remove-inferiors 3". Fix this by matching the entire output of "define remove", including the secondary prompt. Tested on x86_64-linux. PR testsuite/30288 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30288 --- gdb/testsuite/lib/gdb.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 8b85618abcd..bb4bd656471 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -8490,7 +8490,7 @@ proc gdb_define_cmd {command command_list} { set test "define $command" gdb_test_multiple "define $command" $test { - -re "End with" { + -re "End with \[^\r\n\]*\r\n *>$" { gdb_test_multiple $input $test { -re "\r\n$gdb_prompt " { } base-commit: 54bca63b5c3714e1032bf32754dbadaff424221a -- 2.35.3