From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8RsgHx2XMmrC5AsAWB0awg (envelope-from ) for ; Wed, 17 Jun 2026 08:46:21 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=J0rpXSJ5; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7AFF21E024; Wed, 17 Jun 2026 08:46:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id DBBA41E024 for ; Wed, 17 Jun 2026 08:46:20 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 400B14BA2E19 for ; Wed, 17 Jun 2026 12:46:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 400B14BA2E19 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=J0rpXSJ5 Received: from SJ2PR03CU001.outbound.protection.outlook.com (mail-westusazon11012053.outbound.protection.outlook.com [52.101.43.53]) by sourceware.org (Postfix) with ESMTPS id 6070C4BA2E04 for ; Wed, 17 Jun 2026 12:45:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6070C4BA2E04 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6070C4BA2E04 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=52.101.43.53 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1781700352; cv=pass; b=vkKCiDBKJSKUK9zl39aQiqYz2JTbCmc6ns7C8dn0Pw9atZBzaSrt07iXgMobaCGBpntvbu7uL5Ep4aGhRF9LbyUZ6DoLkEgl7aU1RxkNMDet6g3iUOJWD9d6i4S8PCH/CLiKzJ9ZRp4LnaDzBD3D8mrRtd9cIZfHO93jwoki50g= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1781700352; c=relaxed/simple; bh=ZvZNZoS7PkGDNI97a5tbNP8Z90NsU+C4L4X6ivxAw9M=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=U04BaBg8rgd7FNT33oGqmJbCu7jnRxtGbSTXo3TGE/qGngFv2/ouABkLAIs1FrfXAtXrN6jHs0IgFshScfErjpOtnMcAZoWF1j25bYeNClefsdHAPtLrrsftiIUa7yjVubQROM+CE98YsH+znQ0kSrViNfyxz+VM4dbKbT9SUBY= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=J0rpXSJ5 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6070C4BA2E04 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XmoTlOoaKTpVetegI/hocXKy/FhwEcf6xn7cz8zYG3e7vW76iREfwoe+J8ywNpckY1lzrkdWZNKJb4H38rMXeFSAWu1CrFkUptW2NmZF/UYoc2cVLPZXhUTzhvccm4FfcMxPSneV/wmumhBBNsZAMY2Ec5ERncoAt9/hMQuxboW0Bf2MGCxT8zC9C/dtZ6+wIce2ylpUOmdNr7FPuRkX/H34yVgsDjNEbeez6sDlaW2DRtyHyoBjGDQnIhQFDIkmH+YhlDlpX04QaJevR8b5nGpCrJzL+D5bSmRhN81F4dtDbNBe2xDYF1zylyANCjTTf4jM+ccfjBs49ZnpdNrGsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BlwLFHd3Yj932NwxjPOF53sxONIwtXrpMD1g30EE+6I=; b=wQmvKhn/tey6a9UjTLBO0mrAT25xxPWizzAvDJPmKGTzB/Cy53frdhnjzL9TCD/0y1HUpWnowNqPfSvxZiZtl9+AaZIeXsLGOIICsva/ByclVDpsm3Su5Zov0nR+2xjLOKCxcsGb7TFcniK7ZVD0AarnhbjFgR1UxciiyKmJPmocJ8mNImfrUUqtlMMkyXVUollXcvwic0g7u/cm5ni7FUOM89H0bq694xtxCFU+UA2xTbpLtSvsL0rzYAX6IOjmAYVgwAUENJIYQ9lozjHLfKWmv7MTB8VMmWwoEE1c8Iz4yWMxuT1+iQX5KJg0icAhcojsd6b+xbS5cXUFvbWPEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BlwLFHd3Yj932NwxjPOF53sxONIwtXrpMD1g30EE+6I=; b=J0rpXSJ5M0oz7hs5cyHTu1v4rnKnlX8gWC4CbWQmYVCV2sK86w2gaN42vvnvDxXwdZnVWik7AAkrwHl/zpnPp3b2ifO80/+LX5fyAMLFvPm7tBxonKsqI/HNtChFWuw0pcsQmgkGAtEQaDUn1gDRT98s2rhV65HZl/Cvm3IPebc= Received: from BN9PR03CA0392.namprd03.prod.outlook.com (2603:10b6:408:111::7) by MW4PR12MB7466.namprd12.prod.outlook.com (2603:10b6:303:212::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.139.11; Wed, 17 Jun 2026 12:45:45 +0000 Received: from BN1PEPF00004681.namprd03.prod.outlook.com (2603:10b6:408:111:cafe::aa) by BN9PR03CA0392.outlook.office365.com (2603:10b6:408:111::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.113.18 via Frontend Transport; Wed, 17 Jun 2026 12:45:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by BN1PEPF00004681.mail.protection.outlook.com (10.167.243.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.139.8 via Frontend Transport; Wed, 17 Jun 2026 12:45:43 +0000 Received: from ROUCZISSULE00.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Wed, 17 Jun 2026 07:45:41 -0500 From: Claudiu Zissulescu To: CC: , , Claudiu Zissulescu Subject: [PATCH v2] gdb: Remove redundant clear_proceed_status() call Date: Wed, 17 Jun 2026 15:44:15 +0300 Message-ID: <20260617124524.6160-1-claudiu.zissulescu-ianculescu@amd.com> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004681:EE_|MW4PR12MB7466:EE_ X-MS-Office365-Filtering-Correlation-Id: 759a1f50-4c0d-4ee6-7a35-08decc6e588c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700016|82310400026|23010399003|1800799024|376014|11063799006|5023799004|56012099006|6133799003|18002099003; X-Microsoft-Antispam-Message-Info: KMxpYd9ehaCoVi/bIguWcUb5ErDlBfdIXjKJhsVyEi2UWIU05yOSb5G2NvpW9seIIoQOaqPlYnJ7rRzTBEADBBdbA9jCwO76Mhnr2MpGF+KA/BIFp+hPfJ5FKMH77waE42VmCkM+ov1x6gyT90pss0i74rhgK2wj4Tzg+gPp9SZVky6R+9VzoMFWDddQTLTvRsRJt0IfIrbxO8rD2GTqPFsIMLwsvAnO1a6bJaPBojfO1b9b9FkPaNYjO/Opb09hpzBmxaJTUgaM+2Fv4ODDK+1Xs2bAJvDyQ0M1fB/qYKqO1szZiaIhZmc8cGoGTRpRZmR0I47xsA2bd5WEQcBWFAH6SysMb+spaPvCIaBSxsJuoNP7UDn/mJy8hMlLsz5/qXLFvOAZOX1yswr+dmb+tb69XDHdL0pJuvl7/CS7W3QTHhkO+dAeAHqQ3K9zn+Kwpbmkuf34DBOi2w4XrEfEC7BPPFMmE3Omb2nJSZvXJlrv7fR0msmcHE6xA8fy5aBNalzlayd2rO8Y9En0+Vki2Fc6fB1JQGNDUsSCYhyL1FoPMOAt1fQQDzIsHnRQlpqcbZxbj2IQlvs332XSEn1f5z3gR2qBR/ge+rT8bHSPstl7ah0cdSpAPp7idZMx852+URiRRu8II+C4t+eLnyJDi+YhJFmLcxkn+LWiapcC2nsEfriCnrKI36JjdbUoWme6rgO02XvLUo0pE1wIIc8vrb9Iy0LcTrEFS8Bfjb2Zp2A= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700016)(82310400026)(23010399003)(1800799024)(376014)(11063799006)(5023799004)(56012099006)(6133799003)(18002099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pTbbUsecHm0ZO2aL/pzqslsMth1cwEOVPR7I6hxw/dDO5Os0XTm3KFmXt4sR0AYOC0k9AOBqb+Gx1VfMFe2peX9yMeyEnhQDzyMeuFUb7mhQPqMBbch1r1tkWxAYdNf1QstOCDl3pefii21eOzopmOvAz1IZaLsbSShrthJpId/FnJM5gzZzZEFHZNpj27KCYzmtTHosq2BDXIeBcRUiZr8D5fOXR8LKmIyX3ijH18XYXv2rlH8PTYeAUvvuwu3akCoaa3bfFrFtCmvV7Dl/Zifr4TQpXXzozhJo8p1Cw6S1zU0IalUaGMZhzw8R8dbg34yfYv0NdeJ+eDE4MQRlCqw5HUFC490JC663w3HoVaIne5ZousdKLvV0+UR7mPc9sB7j8irfLVGUf2u+E4Re02eMzXHm97HVLKFtQgNXLj82BXjYy+vwf2rzr1HawvLZ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2026 12:45:43.6871 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 759a1f50-4c0d-4ee6-7a35-08decc6e588c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN1PEPF00004681.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7466 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org This patch fixes a Windows issue with "-target-attach ", where "running" is emitted instead of "done". The "done" message should be synchronous for "-target-attach", but "mi_proceeded" variable is incorrectly set to "1" when clear_proceed_status(0, true) is called. As a result, "mi_interp::on_about_to_proceed" sets mi_proceed to 1, and later "mi_interp::on_resume" emits "running" instead of "done". Remove redundant clear_proceed_status(0) call (the notify argument is set to true by default). The init_wait_for_inferior(), which runs on the very next line, already calls clear_proceed_status (0, false). A new test is added too. What is new: - Improved commit message - Added a mi test for showing the issue in Windows hosts. Signed-off-by: Claudiu Zissulescu --- gdb/testsuite/gdb.mi/mi-attach.c | 19 ++++++++++++++++++ gdb/testsuite/gdb.mi/mi-attach.exp | 32 ++++++++++++++++++++++++++++++ gdb/windows-nat.c | 1 - 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 gdb/testsuite/gdb.mi/mi-attach.c create mode 100644 gdb/testsuite/gdb.mi/mi-attach.exp diff --git a/gdb/testsuite/gdb.mi/mi-attach.c b/gdb/testsuite/gdb.mi/mi-attach.c new file mode 100644 index 00000000000..6fd195320a9 --- /dev/null +++ b/gdb/testsuite/gdb.mi/mi-attach.c @@ -0,0 +1,19 @@ +#include +#include + +#ifdef _WIN32 +#include +#else +#include +#endif + +int main (void) +{ + /* Sleep long enough (5 min) to be attached to. */ +#ifdef _WIN32 + Sleep (300000); +#else + sleep (300); +#endif + return 0; +} diff --git a/gdb/testsuite/gdb.mi/mi-attach.exp b/gdb/testsuite/gdb.mi/mi-attach.exp new file mode 100644 index 00000000000..d0bb7e778cb --- /dev/null +++ b/gdb/testsuite/gdb.mi/mi-attach.exp @@ -0,0 +1,32 @@ +# Copyright 2026 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +load_lib mi-support.exp +set MIFLAGS "-i=mi" + +require can_spawn_for_attach + +standard_testfile + +if {[build_executable "failed to prepare" $testfile $srcfile {debug}]} { + return +} + +set spawn_id [spawn_wait_for_attach $::binfile] +set prog_pid [spawn_id_get_pid $spawn_id] + +mi_clean_restart + +mi_gdb_test "-target-attach $prog_pid" ".*\\^done.*" "attach \$PROG_PID" diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index d9e924f16c6..f1660a02175 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1944,7 +1944,6 @@ windows_nat_target::do_initial_windows_stuff (DWORD pid, bool attaching) if (!inf->target_is_pushed (this)) inf->push_target (this); windows_clear_solib (); - clear_proceed_status (0); init_wait_for_inferior (); inferior_appeared (inf, pid); -- 2.54.0