From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2cWfIXU/PWps8hcAWB0awg (envelope-from ) for ; Thu, 25 Jun 2026 10:47:17 -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=jOYS8eb3; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 847D91E098; Thu, 25 Jun 2026 10:47:17 -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 [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 DEA001E024 for ; Thu, 25 Jun 2026 10:47:16 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4C0454BA23DB for ; Thu, 25 Jun 2026 14:47:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C0454BA23DB 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=jOYS8eb3 Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazon11012062.outbound.protection.outlook.com [40.93.195.62]) by sourceware.org (Postfix) with ESMTPS id 3ED984BA2E3F for ; Thu, 25 Jun 2026 14:46:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3ED984BA2E3F 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 3ED984BA2E3F Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=40.93.195.62 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1782398803; cv=pass; b=L3KZbCszlcFJ+Z0pKByy15xEJBluyiIv2Z+iUTvlaMp8zNXh7bPVYW8XCzoNoll5267b2b2PN2EKypykt4gYnO+cXeHi6clILldVxfyzAUa+F1Pwv7UxNNG5r6ylf0xccuJ5zwRuYgBRacEqv/PE7QoLSoaWjY9YdWzQ+NU6pdw= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1782398803; c=relaxed/simple; bh=X98d52Bui6NMenuXu+asoqYQPZjOIwZau7VzcdDfrCY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WhBHU3lgxBWQFo1woGyokgur6Tz1R4VzMkTpXoAaOMMu5wF5cx8pjxOnA/+sj2Zr5MivUpHGwIr/eh4KWlN5WkIavm+6gCeDdDPj2y49d8y4wIHCj2SnkFrg7Wx76pJmARdF9gEo650bf6D4U04V7BH2njWwzdXNGcerbMt46yE= 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=jOYS8eb3 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3ED984BA2E3F ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dxoht8olV0/PexnOM652jdy03dN+cySjCsFmiRFdGXfhLzw60FOtO6iyEPwEDRU7x/qQwcJngu4e9/AhBVftSYeIPjBBEMeNRoVtf2jetyymnWA+FE8EZ26sxbooTSjMcy24r59GrIQvxjh/nDaD8HQ62AwPnz5I+ObbJFfJX7Ougvq0cFY3VxhAomCRh74zCDIb5Fb28pSC66LjI/PSVrSSG7wNhGZQSJqbHrskenUMJH56+Z1BCnJaRPNdq5ym+vtbXD0nY6kQIMJgahpoeICmDUgEGKw6ix7sDsQ6GMyASSmoZ4C+qC14sIimUOBON1xkyqTCUy9ZVnbCP/2sPA== 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=RCsV+91k6pVU2E4D8FizeG+8YCzvLD3QqYbwwmF4DJg=; b=MS5xW8kY4qgdtSiR65t62zHHi4VAwvsr/xJ/XoNPoRcEZu9av6xyCPuN3R+6R9g2ioIPUxoFqk7yleMGdQ/9g/StUKRtnRgYv+tCsHg+09/VANXy3P/XXY5SrhXzDbzu0h+gw40DRFuIu3xFoyZGGqxPDJWvRAfp7bIuZ2OedqKzpki9Co4gvQvm9ng+30CPb3AcFb2KNp4fEhZnzoEV6PsgkawfyKmPfesftpNpySX2+kb3ScwqCiaHG/PFF+DOWP9K+uNdPJjC+X7daCt5nbEMK6sBwNKosq7ElmjyLx5KA5Z/jZyHj3XhvoQCqrSZQX72IbI8as7jGp9VVnBUGQ== 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=RCsV+91k6pVU2E4D8FizeG+8YCzvLD3QqYbwwmF4DJg=; b=jOYS8eb3O12ASAjUmMZy2NzY7BapUmaCM+ivfg9fNtDV+r0fKdYyF3o6CFxhg+VWEcrzNg0pqMpyolQY4yupLUiwk9xEcVUM3Fmc3WF2NDMmWTxzwcNaPgpWaba3K3XK6nxRswRvL0KYrPaLWJr314N5sb3tt1ARdfT1P+3RznM= Received: from SJ0PR05CA0020.namprd05.prod.outlook.com (2603:10b6:a03:33b::25) by CYYPR12MB8731.namprd12.prod.outlook.com (2603:10b6:930:ba::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.159.13; Thu, 25 Jun 2026 14:46:36 +0000 Received: from SJ1PEPF00002314.namprd03.prod.outlook.com (2603:10b6:a03:33b:cafe::6c) by SJ0PR05CA0020.outlook.office365.com (2603:10b6:a03:33b::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Thu, 25 Jun 2026 14:46: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 SJ1PEPF00002314.mail.protection.outlook.com (10.167.242.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Thu, 25 Jun 2026 14:46:35 +0000 Received: from ROUCZISSULE02.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; Thu, 25 Jun 2026 09:46:33 -0500 From: Claudiu Zissulescu To: CC: , , , "Claudiu Zissulescu" , Simon Marchi Subject: [commited] windows gdb: Fix -target-attach result Date: Thu, 25 Jun 2026 17:46:11 +0300 Message-ID: <20260625144616.9887-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: SJ1PEPF00002314:EE_|CYYPR12MB8731:EE_ X-MS-Office365-Filtering-Correlation-Id: 1dce8fe4-7817-42d9-9895-08ded2c88e11 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|23010399003|1800799024|36860700016|6133799003|18002099003|13003099007|56012099006|5023799004|11063799006; X-Microsoft-Antispam-Message-Info: IOduxrvFTMbnwAGtjmZ76K+djxRuLZdr37TDiig8S93tDWCjreK9QR9ikGrzJhorzQRYhYUenLgAHLgHOAWmdOp8RVk1iKwBnLiWKNa9x+wpZec5xBXb0ZWrPHO1/9e+jpyOc0LQ1XPLj/QzffUdzkQK8T8/bhZC8ftwoSjZNLbaDkr6sh68D1KXIh5rBTK7mvhpVb2ztpyN9XNLKLIzE777/3Tiuuk2woYtjOdyFk7wBzhHJg2XBLKbhnwkYkQMqNXb34svfelMLLZ2/Ay48AqdjCbSQxmG8hzc/zLll8tUm5E1Vq6wS3vkqkfrdK6csfXgSY2Y/pKAR2YOJ6oi15CIib36Lm4uX868TmgdNJlNKkxWL/spEjNIXWLAVpWsS4BmBf34XCgtPwnbQ6Vymg/zFPYgpj7NwZkYqaPMpxFzLdL2TQ7UlATBLjMFgH8JhZrUGWMx+u+TD/hvGvwU0ucp/n76k2yw/CKX4f1T6QJOdp20jFOh2mr18YQ3nhG2cSoBz/ITHX8MEQUsWCRrV8ir3V7Ltjnk67IlIPXl6JOnGTcdU68CHCF/zcnk6b1XzFubJ9J9M8SUI0peDK1UOlalZb+L5V4q91JaM04VMkV1Dk/87mLrEB1j9D4B0TFmgkeNDra1OSjgP32LaoqD5fYhFr4LAPhkkfEn5Dj2xcc94UjgxczGgQYf+iZ2MMb1B75L+TOFRntgQOkZ3Y9Qig== 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)(376014)(82310400026)(23010399003)(1800799024)(36860700016)(6133799003)(18002099003)(13003099007)(56012099006)(5023799004)(11063799006); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /M8dF3nMNY36+iZNo7jwr6kmePFMyKoLAIjDhxevXF06gw0isLY9GxwlvCoXXI2iD0S37K2TphQnUoOTThVSh8+QCh+Q46bXIb8yny2y1DOQa3wYSaXdYSnTetAz9MpYc3T9h7LXfdsayZrc8PKQ8ZNe1tJa+hh6XZ8vv4zjtxHpkPrDJcJOrt3YOfg/1JrunyRtkQedrs0Q5scrn69u30SavDEvK/t4AJHL8phLi3DlZcISrAEQZ62xW+7/RAb5n3vDeGigCRncJ3oLNT7MZi4YKaopG6HYJgOX2i4HaFR856SNwLMicsD1EERFxltZFYbigB7kVVbvLLlzuEynFBcd0YBD6gMEc6Ex0BGYmUDxcvGxwIu2dfWMc/+4ZGWfGm+gQxb0d4wOIkS2tGhfvPrgdayU4vlPCxznrzzv+epEXBMIdR0jG58V71RuS8et X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2026 14:46:35.1333 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1dce8fe4-7817-42d9-9895-08ded2c88e11 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: SJ1PEPF00002314.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8731 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 Approved-By: Pedro Alves Approved-By: Simon Marchi --- gdb/testsuite/gdb.mi/mi-attach.c | 37 ++++++++++++++++++++++++++++++ gdb/testsuite/gdb.mi/mi-attach.exp | 33 ++++++++++++++++++++++++++ gdb/windows-nat.c | 1 - 3 files changed, 70 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..9c58ccb3728 --- /dev/null +++ b/gdb/testsuite/gdb.mi/mi-attach.exp @@ -0,0 +1,33 @@ +# 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" +kill_wait_spawned_process $spawn_id 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