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 47BAE3858D1E for ; Mon, 13 Mar 2023 15:47:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 47BAE3858D1E 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 8004C22138 for ; Mon, 13 Mar 2023 15:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1678722463; 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=mnC75A+fY1SAAcUqcLSsGf2hTdaLtR/2AKloF11P6fg=; b=vfjdrjfrslktISt65aUaHZ05gCUP7UkarPHXbakF4n+0KigjwrRrP+2oEIOiZSHn74zBMR OrGBaaTBIMYvpfKY9KUpgEds7ekfLPZpPwAtWJuPFP72Gzt0fpoddImkkJVw2LeOGZ3Zfa yQDc1E5QBZ9rqelpsIH0h8TaQxk5Ol4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1678722463; 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=mnC75A+fY1SAAcUqcLSsGf2hTdaLtR/2AKloF11P6fg=; b=8nHB1BYCA87r85IBAXvH/b+zUf4X0RVY6gVY5vFJWCU0y79k2QnOpYugDB/wJkikIK81YW 95pBl8yBV9lO/YCQ== 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 6BABA13517 for ; Mon, 13 Mar 2023 15:47:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /lW3F59FD2TmdwAAMHmgww (envelope-from ) for ; Mon, 13 Mar 2023 15:47:43 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Fix gdb.threads/step-bg-decr-pc-switch-thread.exp for native-gdbserver Date: Mon, 13 Mar 2023 16:47:43 +0100 Message-Id: <20230313154743.22618-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/step-bg-decr-pc-switch-thread.exp and target board native-gdbserver, I run into: ... (gdb) UNSUPPORTED: gdb.threads/step-bg-decr-pc-switch-thread.exp: \ switch to main thread Remote debugging from host ::1, port 43914^M monitor exit^M Cannot execute this command while the target is running.^M Use the "interrupt" command to stop the target^M and then try again.^M (gdb) WARNING: Timed out waiting for EOF in server after monitor exit ... Fix this by following the advice and issuing an interrupt command, allowing the following monitor exit command to succeed. Tested on x86_64-linux. --- .../gdb.threads/step-bg-decr-pc-switch-thread.exp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp b/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp index 44899f6afa7..ee7c374c7ac 100644 --- a/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp +++ b/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.exp @@ -55,11 +55,22 @@ gdb_test_no_output "next&" "next& over inf loop" set test "switch to main thread" gdb_test_multiple "thread 1" $test { -re "Cannot execute this command while the target is running.*$gdb_prompt $" { - unsupported $test - + # With remote targets, we can't send any other remote packet # until the target stops. Switching thread wants to ask the # remote side whether the thread is alive. + unsupported $gdb_test_name + + # Interrupt running target to allow subsequent "monitor exit" to + # succeed. + gdb_test_multiple interrupt "" { + -re -wrap "" { + exp_continue + } + -re "received signal SIGINT, Interrupt\\.\r\n.*" { + pass $gdb_test_name + } + } return } -re "Switching to thread 1.*\\(running\\)\r\n$gdb_prompt " { base-commit: 66889870fa635c4cc034ffb7ade24087361da75d -- 2.35.3