From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id D4C263886C6D for ; Mon, 7 Jun 2021 13:46:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D4C263886C6D 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-out1.suse.de (Postfix) with ESMTPS id E6F7921A97 for ; Mon, 7 Jun 2021 13:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623073608; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=JX1zWU0Zuau5oyoRGe5M5bIIhOPaCbomnTRQ8b2rnok=; b=smnTi3sJ0lrmHYQGWvLiA34QaN9IymqX7T5YClg3A9EMlMMaUGFZzCxQMyK9dXMNAggady brduTv/LnNco1okJeZQUrRqKnyIiCDQsetYAFdLvHB0D++7MIbceVwOwNTMyvp6t2xkD79 LVBayBJr5hkYNTWVTMyuWl8TJipUkYA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623073608; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=JX1zWU0Zuau5oyoRGe5M5bIIhOPaCbomnTRQ8b2rnok=; b=dnHvHGMb0qhsQhHaTDOoDrXLsy+dLlAXuZ6SKWJjG5/MxyN2Y1Jv97LuWHTGYDyjWIJ5M6 +QPicEf5czR3rGDg== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id C9B1F118DD for ; Mon, 7 Jun 2021 13:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623073608; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=JX1zWU0Zuau5oyoRGe5M5bIIhOPaCbomnTRQ8b2rnok=; b=smnTi3sJ0lrmHYQGWvLiA34QaN9IymqX7T5YClg3A9EMlMMaUGFZzCxQMyK9dXMNAggady brduTv/LnNco1okJeZQUrRqKnyIiCDQsetYAFdLvHB0D++7MIbceVwOwNTMyvp6t2xkD79 LVBayBJr5hkYNTWVTMyuWl8TJipUkYA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623073608; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=JX1zWU0Zuau5oyoRGe5M5bIIhOPaCbomnTRQ8b2rnok=; b=dnHvHGMb0qhsQhHaTDOoDrXLsy+dLlAXuZ6SKWJjG5/MxyN2Y1Jv97LuWHTGYDyjWIJ5M6 +QPicEf5czR3rGDg== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id zJI7MEgjvmCULQAALh3uQQ (envelope-from ) for ; Mon, 07 Jun 2021 13:46:48 +0000 Date: Mon, 7 Jun 2021 15:46:47 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.base/run-attach-while-running.exp Message-ID: <20210607134646.GA14459@delia> 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.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.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 13:47:00 -0000 Hi, With a testsuite setup modified to make expect wait a little bit longer for gdb output (see PR27957), I reliably run into: ... 27 return SYSCALL_CANCEL (nanosleep, requested_time, remaining);^M (gdb) ^M Thread 2 "run-attach-whil" stopped.^M 0x00007f13c85a74c0 in __GI___nanosleep () at nanosleep.c:27^M 27 return SYSCALL_CANCEL (nanosleep, requested_time, remaining);^M FAIL: gdb.base/run-attach-while-running.exp: threaded=1: \ run-or-attach=attach: non-stop=on: test: attach to process (timeout) ... The problem is that we're trying to match the gdb_prompt using gdb_test which uses '$gdb_prompt $'. The terminating '$' prevents the match. Fix this by rewriting the gdb_test into a gdb_test_multiple and dropping the '$'. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.base/run-attach-while-running.exp gdb/testsuite/ChangeLog: 2021-06-07 Tom de Vries PR testsuite/27908 * gdb.base/run-attach-while-running.exp (test): Don't match prompt after attach using '$gdb_prompt $'. --- gdb/testsuite/gdb.base/run-attach-while-running.exp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/run-attach-while-running.exp b/gdb/testsuite/gdb.base/run-attach-while-running.exp index 7c16aa6f5c4..1cc754a87ee 100644 --- a/gdb/testsuite/gdb.base/run-attach-while-running.exp +++ b/gdb/testsuite/gdb.base/run-attach-while-running.exp @@ -33,6 +33,8 @@ unset binfile # - run-or-attach: "run" or "attach" proc_with_prefix test { non-stop threaded run-or-attach } { + global gdb_prompt + if { ${run-or-attach} == "attach" && ![can_spawn_for_attach] } { unsupported "attach not supported" return @@ -91,7 +93,11 @@ proc_with_prefix test { non-stop threaded run-or-attach } { set test_spawn_id [spawn_wait_for_attach $::binfile] set test_pid [spawn_id_get_pid $test_spawn_id] - gdb_test "attach $test_pid" "Attaching to program: .*" "attach to process" + gdb_test_multiple "attach $test_pid" "attach to process" { + -re "Attaching to program: .*$gdb_prompt " { + pass $gdb_test_name + } + } gdb_exit kill_wait_spawned_process $test_spawn_id