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 EAB213952003 for ; Tue, 8 Jun 2021 12:51:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EAB213952003 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 054C91FD33 for ; Tue, 8 Jun 2021 12:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623156685; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=4wFHySlhVHkuVKDdJPf2534pkB3s44xLf8dxjWz/L7k=; b=gnrC4NQ6B1Gj0WzEztf/FrHwoe4DfUwj69X8Nz+og5JHtp5qQ5hXv/bfr59vNgGE0ZTscE 1TEWFhRb46J0Syrr8SsM5/YIoBpt0YhCqbJ4rztlAaMMZe0WCxRg7kQRWsPVTr1LUQe44H t8DdEwL42KkTwwIxL05YZQ8/3mxF9HI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623156685; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=4wFHySlhVHkuVKDdJPf2534pkB3s44xLf8dxjWz/L7k=; b=mvgBP97GRFLsysl0/oYE0GTsbDQjFeaeYslmcWqVTQRn0+1bJgE+5cYcLI4KwvpZAaFpHw Dr3SJCalzxFzxUBg== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id A1C51118DD for ; Tue, 8 Jun 2021 12:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623156684; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=4wFHySlhVHkuVKDdJPf2534pkB3s44xLf8dxjWz/L7k=; b=v4xCZ6jChmOpIjCaHP20f1KTSpOuKR4nRh5Tvhe2VC+191KKmsdqYP2RmQWYGZO40Cu4nk Ye7CVNbIv6+w3RYQlM1qdWmNUp2WJxKomeP/J8WNK0w7Sf83DlvVj/c3GUjMrgObfMR7k6 T/M46jKypR8p7N3Xy/zItpf43r9l9kU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623156684; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=4wFHySlhVHkuVKDdJPf2534pkB3s44xLf8dxjWz/L7k=; b=73AyqBIQ0WUhnFIAnLCdiKaq/0x64cGBvYt61gIayzaVTSkcfisjAtyN40k5vopFBE3RxT cqaZC8zY3a+Ek3Bg== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id fwJTJsxnv2BAUgAALh3uQQ (envelope-from ) for ; Tue, 08 Jun 2021 12:51:24 +0000 Date: Tue, 8 Jun 2021 14:51:23 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.base/batch-preserve-term-settings.exp with check-read1 Message-ID: <20210608125121.GA28163@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=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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: Tue, 08 Jun 2021 12:51:28 -0000 Hi, With check-read1, I run into: ... FAIL: gdb.base/batch-preserve-term-settings.exp: batch run: \ terminal settings preserved ... This is caused by spawn_shell matching too little output, after which things start to go out of sync. More specifically, the regexp: ... -re "PS1=\[^\r\n\]*\r\n.*$shell_prompt_re$" { ... matches the first and part of the second line of this output: ... PS1="gdb-subshell$ "^M sh-4.4$ PS1="gdb-subshell$ "^M gdb-subshell$ ... while it's supposed to match the entire output. Fix this by splitting up the regexp into a part that skips the lines with PS1, and one that reads the shell prompt. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.base/batch-preserve-term-settings.exp with check-read1 gdb/testsuite/ChangeLog: 2021-06-08 Tom de Vries * gdb.base/batch-preserve-term-settings.exp (spawn_shell): Fix matching of initial prompt. --- gdb/testsuite/gdb.base/batch-preserve-term-settings.exp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp index da39485c00d..1f042097a06 100644 --- a/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp +++ b/gdb/testsuite/gdb.base/batch-preserve-term-settings.exp @@ -44,10 +44,20 @@ proc spawn_shell {} { send_gdb "PS1=\"$shell_prompt_ps1\"\n" + # Try to match: + # PS1="gdb-subshell$ "^M + # $ gdb-subshell$ + # or: + # PS1="gdb-subshell$ "^M + # sh-4.4$ PS1="gdb-subshell$ "^M + # gdb-subshell$ set gotit 0 set test "spawn shell" gdb_expect { - -re "PS1=\[^\r\n\]*\r\n.*$shell_prompt_re$" { + -re "PS1=\"$shell_prompt_re" { + exp_continue + } + -re "$shell_prompt_re$" { pass $test set gotit 1 }