From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out203-205-221-149.mail.qq.com (out203-205-221-149.mail.qq.com [203.205.221.149]) by sourceware.org (Postfix) with ESMTPS id C8E193858D39 for ; Wed, 15 Mar 2023 15:00:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8E193858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foxmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foxmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1678892426; bh=Vt+/XCmAxhEl9q16op8/nUcVi9TFE1zghUn859r5fcs=; h=From:To:Cc:Subject:Date; b=AXMSkY8edHQXopqc0sD8j+bG+JZUqcoxa0eE5QvG02a80WeiGhrAgeGsVeEwds/Yp 0wn9bVnhYxcz2oqK9LeNs/kpNvMSw/zETCg6Bl9m3FPvih2bKJSLmMRP3vOSrnfQLK 2Xquzau2adRst++tWymNgU8bSHN/lmO3zlXC8Txs= Received: from localhost.localdomain ([122.233.204.7]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 1884A45; Wed, 15 Mar 2023 23:00:24 +0800 X-QQ-mid: xmsmtpt1678892424tb5jw1bfl Message-ID: X-QQ-XMAILINFO: M/sBYxuwFsVoehSq6Fi5c5v2x9XoCSs9jM/8RESMMieRRrxmzrS0ud+kqoFr2L dZ+3C+rpMcE3urYldxfEu6/DVnk0dCXWtEWFzE3sO8OLnls6jCL0O+tgwQqsDMoz9fzRwTDAgs5V cjwKPYJ0ABV7rUZtguTzbG0m39DRXCC7HfSEL5HVyNKOIITgP3HvUS/tRCnUyItVnKd4Y42onG9V IOME+92GgIe6X4702vSdvdyn8zwCSlpjCv5XqLUvD7eLX13BjWxBOGKlZFcHVElngiQBwokyIVOn ru9HmZasSJO/pR3hAX0kg0g72JWkcNQMkp1m9VW3mUnEHCLbDR7rebNIfEVE7o2+REpMXFX6ih// EHnEVSVx7Ppi6qUYaJMRldgaU7E+ufJon+HFTuuU5FsOfxgi0CvqLEuL3hQhM4owBYxfX+XMDYtV uMF8LIYd+09zNEZ1Jp3b+slb2xApwHDXF/eENftqqEkFnv9u71gTVIOEGLDobXXguxb1DcZjH6cs ZtqQ0oKeyc9WzusRDj6DQTjUHLlY7C1gKtKY8xne12DGyBwFyBeiN420xA04Vnc4tsw60lvAfped S61BgjU2ZUuEhnDaaVT3GP9AE0pKf2IdocP/pE2CGb7YwZ8Fev7mpRa+iTe3e3sBBaZIRdpjoVkJ iHfbQlKay/WBsj7n98ShBWzutXPhjMoP7b46wzAlnRv3B2DxqnENtNZ/M/SGN5nuGaxP7VB/+NkQ qbGU0LuQQaNEwD+UTKaR9RyzzHu3Qq5qWCdu69P5E+fNHEDdlX6dRkfm0I/zFQutxWkY6xQgZYk/ DEOy+h9u8s2PuJte8EkA5jqTSJ84g3GTdYwDTtW5p3ZXKvDPjHU3jixtU+qDOX5mdjt8gUtkObW3 SDQ+DY3N7wuiEDWdBPKkyYAu4sLoe7krbesYWhgFZHb3puhY7MPnMXGymSM4iNTZefH+sGVneEec Rax813v+oOQCwBhzNHyg== From: Xinyu Lu To: gdb-patches@sourceware.org Cc: Tom de Vries Subject: [PATCH] [gdb/testsuite] Fix gdb.threads/step-bg-decr-pc-switch-thread.exp for native-gdbserver Date: Wed, 15 Mar 2023 23:00:16 +0800 X-OQ-MSGID: <20230315150016.45240-1-lu.xinyu0121@foxmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,GIT_PATCH_0,HELO_DYNAMIC_IPADDR,RCVD_IN_DNSWL_NONE,RDNS_DYNAMIC,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: From: Tom de Vries 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 " { -- 2.39.2