From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IV5VIv+BOmok3xQAWB0awg (envelope-from ) for ; Tue, 23 Jun 2026 08:54:23 -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=BaUav7Jq; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 877251E024; Tue, 23 Jun 2026 08:54:23 -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=unavailable autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 D6DC61E024 for ; Tue, 23 Jun 2026 08:54:22 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ADB7E4BA2E24 for ; Tue, 23 Jun 2026 12:54:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADB7E4BA2E24 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=BaUav7Jq Received: from PH0PR06CU001.outbound.protection.outlook.com (mail-westus3azlp170110003.outbound.protection.outlook.com [IPv6:2a01:111:f403:c107::3]) by sourceware.org (Postfix) with ESMTPS id 3A4404BA2E09 for ; Tue, 23 Jun 2026 12:53:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A4404BA2E09 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 3A4404BA2E09 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c107::3 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1782219224; cv=pass; b=sTIDtjiyXtdbaAbFEIeeirrOOx5DfGGD9Keodmuv3zkoHC56juzZc9uxKDCP8e13IN+0hhoY1QZ99ct1/HdeyhJ1kE3KZnhToG9pLnmnLTvAdJX7e20Me4BfZ+ocAFgRgOA6w9vo0ViwDKIQ9OHklcEOPTO8ko4sqMzx+MzT6Dk= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1782219224; c=relaxed/simple; bh=uyNdkT2XSbywzfqCtgUYSTgokVrlEf8vucC00eZiTZI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tQ/NIolVZ4U4f5hw3IHVaCkW7e7yY7GzUGE/ALfdMcC+xMRaKpi9/Mbmx8ELE5b87krmTFcpLTvQUhSK6w6Sk/b/AEbo8W7ceLOGDQ/Q/vmB51ttGfX6+LF85j0XX1sM2xrY1abBVizjLze5DDLZi72EFnimC5X9nf8DEYTX7jA= 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=BaUav7Jq DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A4404BA2E09 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TW550XBrcgD1SutjT6u+So6KBW1e97c4w7CEm41/Dj23r25KJkzTm1LciivbdjarsH/+zn8LwR9BVOefIlgh/ePU598lTTcFkBJ4cvQFg+RNzlTJ9FB0h3kYKN56BXlT3cJmKzla8Vf3A8eglUrkUNCJ52cDAJoBnXpyaelY3abLzQ4KEbTubRUsbSlo+czU7tU64UFPs3uwBkGXyDaGZ1khvZLsRM1ye73YuUsPofMQo5H9CE0+5h04tUfozaSIkWH2XzRX1LR3iTJr+Vx1TNKEqbuQcyqVJWxfkbxETpk/bz4DZ4dKuBO8fHGStaODDOSZIG2y2+P8fJiUxoXhcw== 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=D17m63OQFAUSZA2SfGCCYpB10BVMG0HoPJWD1opTmJk=; b=f+d+5r+eoerH/5/dsNl0PiVd2JHViWroTxVeLQ9G5mn8Bia6pJ+ii62dom267vin+vFRXoYnUBoWZ9cxAV0wJW9PHbakABvjED5ma4/N90DfsZHIRvVwjUw4Q27fR4gfl2TDc/CgFu7yUb2TWsyTsgN2W1K10WxRuiIBBXrlfE/6EQz1030J/0JVKjvq8XHz5541lj1NX/H1hRIV/DAXeJq2oyp26u+fl/8Tr09/en1R5HgqSCgKRIowcLuY4hlDQlZsp30NxCqOW4AmoGj3ThbofO+Pg/WoUjo3YZ9JIXdCxhsHp+cLBbXgf2mVQxgEUMkYU1d7d6kXVgqfVpGp1Q== 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=D17m63OQFAUSZA2SfGCCYpB10BVMG0HoPJWD1opTmJk=; b=BaUav7JqTBP4ztPgLJoXFkDfRJD0Kdw/sxiNWOIMIr2Fo6NgCVEN+Uz7iZXIrrJyDGJ15ho9Ms0ztbMNeE+1PDJYAfm/4X1ysByjy3HfTLeh/mJIS2xrqO5xCpA4BkclDXJCqA6PV5KCLUxP6g6Z6zpRMjJzIkoFgiosvHZZYiU= Received: from SJ0PR13CA0167.namprd13.prod.outlook.com (2603:10b6:a03:2c7::22) by CH3PR12MB9282.namprd12.prod.outlook.com (2603:10b6:610:1cb::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.139.20; Tue, 23 Jun 2026 12:53:37 +0000 Received: from SJ1PEPF0000231F.namprd03.prod.outlook.com (2603:10b6:a03:2c7:cafe::93) by SJ0PR13CA0167.outlook.office365.com (2603:10b6:a03:2c7::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.159.11 via Frontend Transport; Tue, 23 Jun 2026 12:53:36 +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 SJ1PEPF0000231F.mail.protection.outlook.com (10.167.242.235) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.10 via Frontend Transport; Tue, 23 Jun 2026 12:53:36 +0000 Received: from ROUCZISSULE02.xilinx.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; Tue, 23 Jun 2026 07:53:34 -0500 From: Claudiu Zissulescu To: CC: , , , "Claudiu Zissulescu" Subject: [PATCH v3] gdb: Remove redundant clear_proceed_status() call Date: Tue, 23 Jun 2026 15:51:37 +0300 Message-ID: <20260623125317.11174-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: SJ1PEPF0000231F:EE_|CH3PR12MB9282:EE_ X-MS-Office365-Filtering-Correlation-Id: 95b07bed-b4fe-4c84-3a44-08ded12670f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|376014|36860700016|23010399003|13003099007|18002099003|5023799004|11063799006|6133799003|56012099006; X-Microsoft-Antispam-Message-Info: f/Y/lxUEGt9Y698izbjZopfiW/kG8FIA/+7VraObQtOzm0zchpmeHEOV60g9EG32V5Kh7U5aNW9eOorPHTrWmkFuBEZDAuwAy3FdrM0fBEgOQwckmjjgXN7v89hPGXttyRvoh1/CRX8Sj/UH1TNlMB9/XTvM01fyUVrhyqSwS0Yqf7KcNKr8OGgCtwLweWT5J3yd+o9KyTGPRllWhZcBOH7vJeD4KVtk0w6vidPFh1AH1L6WLS5N4yVqujTJp3F1w0oZQp+3KzuaoZQWdf9dxdHE7QdyW0/4hpu2MCSlR16uhJRm5f1Per0l3g5IjqHv/OWk47/3v6Qi5wH3iX3/cYQjwhIcdylzKaOWgr2AtJwCM/QRf9ZWFBnrQjbe2Dnxxr3QoxdsuWKuy/wGOERXGNMY91HOZff99FTp18pbW4Kn0IM90bkg+Q88KCv90yxxYJf1RCPt8nHB679G6tvDJQs84nN57jCiAgB83inQu8F0CIMDdvLwhav7m1TpVCkF4YCecCHt55FXLCVlT6OLNKuBB6y6BTwTtBLElIlYoXWhCsmA364V1rSrbZVpUcAIA0WRMUFrELR2tV6uhqg7Hkoa2HOjMLv98kaToqvNNjlnk87k4BNnghbIuIXz+vL/thsfCMihRopAR0q+tE1HAVqjEKlHwlI+y6SRtJOqEUBJXytH8y4/6OlU5K4fV3dG5uCtP0q8+l3iS9dN2RBE7A== 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)(1800799024)(82310400026)(376014)(36860700016)(23010399003)(13003099007)(18002099003)(5023799004)(11063799006)(6133799003)(56012099006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WeWJFXrrpzA0ygQF8v6Lr8COApc7IMcj4KNaXT2L83SEuIs8Gcf/V0HFF1HWYDyZV/DBM8+VIrRw765Prv6Sja2oVm15DH0hiTAR7rtrY4lMLSf9terA9XvET/oFuZ0rXZJz4wuaaGJEN0S0scynN5P50j9FCXDy9m+6O0VL//+c0UeaJ10ucBQuB30TGxXJA6bfvqphEEq1bIhuquV9iyg5wHUcl3dIzexNRy3+rxmTKw96z7Cn06pTkNBwEIBbhakYnNluMJR5Pp1/mUjkaXHVdU5XlfpT0LKqEI43kcWozCQySuOGxwo1Pi5l9WtXSHnxQBsuIsKLCybeMmhBwNzg0DNT5KGV0fwpmbm+kHmFZpw2YUTPgiiM1w3JB/SKcxpfWOMsSQvah7n72o4qzys7lmIgCyBd2dIk+LmTMpdhTE0+mNLmmTApmJwhsZGT X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2026 12:53:36.5856 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95b07bed-b4fe-4c84-3a44-08ded12670f4 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: SJ1PEPF0000231F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9282 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. Signed-off-by: Claudiu Zissulescu What is new: - Added copyright header to mi-atttach.c - Fix coding style in mi-attach.c Change log: v2: - Improved commit message - Added a mi-attach test --- gdb/testsuite/gdb.mi/mi-attach.c | 37 ++++++++++++++++++++++++++++++ gdb/testsuite/gdb.mi/mi-attach.exp | 32 ++++++++++++++++++++++++++ gdb/windows-nat.c | 1 - 3 files changed, 69 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..0ec0a0c161f --- /dev/null +++ b/gdb/testsuite/gdb.mi/mi-attach.c @@ -0,0 +1,37 @@ +/* Copyright 2026 Free Software Foundation, Inc. + + This file is part of GDB. + + 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 . */ + +#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