From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +TeUIjLX62m5UzkAWB0awg (envelope-from ) for ; Fri, 24 Apr 2026 16:48:50 -0400 Received: by simark.ca (Postfix, from userid 112) id 88B741E093; Fri, 24 Apr 2026 16:48:50 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham 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 F033B1E093 for ; Fri, 24 Apr 2026 16:48:48 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 8BC964B9208F for ; Fri, 24 Apr 2026 20:48:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BC964B9208F Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by sourceware.org (Postfix) with ESMTPS id 113644B9208F for ; Fri, 24 Apr 2026 20:46:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 113644B9208F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 113644B9208F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777063584; cv=none; b=Ej3WfIvYIhEY83sEjvclIzeEdLLRkoAIZtEqTnoTSqD4F0r2XsMpQ8qIVzG531/04NMZvtXGW3iWYugF3fKkDdYi/Hzfhx7Ord/uQQy1lkpn7dpp6/bZq/jR9sZNHCmczcrtFhTvDcqrJIRGPcNqsI8RPOASQ3pEe7rUeu5b1F0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777063584; c=relaxed/simple; bh=gybfYHVSWO+49oWtpYguSXN0llk2F5tM6rYglTbEIOk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=DcErci2T3gcAwRfR6r754p77xyu712eL4e21iV9+t6WrpOHdt4CtNgAfbAmq56Jj7lx8B0bneFCvzd7ZryaQu+pUpGdkdQSwAEzuauRdwS7ewQuMLXyc8a0ZWbPXmv1HVH71OCLGCtM1oDzBiujLh3F0cNWANcwP+NKGYnGwhQ0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 113644B9208F Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-43cfce3a195so4762305f8f.2 for ; Fri, 24 Apr 2026 13:46:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777063583; x=1777668383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=L5tmMvNo+xRW7nbJsIa7CEseq6ZUNLaOrgkLQumEUWk=; b=JSr0I17lNm41EANTk54p4KG1e8wZ3OZOrOCfXMrGt27C8VdRaYds1Udchf5VVUjW0s YWmLSVQck7cP60oPKMNZGvbD0UMvVAo7XbqLjd8dQq2FgG1B9b6F8siyMFaXANdmlA// 9TTu7DuKce3uQVWjQ4D6qQHa3qmI0bbU1vxfYZjETGGNZBVKjsFvkDYjSOhxmZ6wc0qB 9Eqvk5wTHWUEjB+6Z5ZT115rVgWY69XjxR/oyq1DwXO2B6y7e7KYfqm0AfVgE7QzSKH1 w63a3iSq0nN7rvwYflWzX54dkFppRGv0uPf2bZze3RZcNgCSd1L/uy+uhloUU3mAWwa8 N8KQ== X-Gm-Message-State: AOJu0YzVDZRXMJaPRKbiB+U+GgbV5b8ExsR7uXU0cNXNoBmqSmotaDbf AZ09Jy077WHiIdX+zg/ChTpBSLOYAuPZX96E+r22l2YfueEIyQh+7h/PRUB7wnRZ X-Gm-Gg: AeBDiesG/JXX0MN3E8iLnT+Jj6f0zgRJGdYQHudHfaZQ2xjj7SYsKxiqi38gsXD6BCg C2YuQ6TgftseVyTyEzN+ow4FIz8PNogNgySZx+NPQIWlF6R66gReuauMO5lRq9gsMr95xz1dju0 XOJTLW6OjO2kJa2H8URrz7manGx0ajZJSeveQFwcF62Kl7dvz7tXunDk6UHmVYge7e6cXliOTIH t6Yt/WTm60olHphD7XTw2oamliYZ+uIFhP4dIfs/pXKGWk3tvX8ktOHdjyq0lHYEj6sajQGJNqd eNK/pqAZpZXe54a/ZAQuIE4JrpMq+raPW8BB0C3JajHvKclVSLwnSBm7GIlbJEzg9Fo9G+WeMAG 4w+2+oV8N12S/veLsw7zPyZ5WLrDcR2myzrShR+ydY2fgV2rqEMq9qxpdJwnYp6oqg0eQTp+cbs sJaTLxjOdugNMxMHO2PAKjuo1d+jM82tCh X-Received: by 2002:a5d:584c:0:b0:43f:dc86:d61f with SMTP id ffacd0b85a97d-43fe3db30c8mr53513774f8f.14.1777063582600; Fri, 24 Apr 2026 13:46:22 -0700 (PDT) Received: from localhost ([2001:8a0:facb:a800:7315:8865:c664:fc06]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-43fe4e59f97sm68511393f8f.37.2026.04.24.13.46.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Apr 2026 13:46:22 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed 24/28] Windows gdb+gdbserver: Eliminate struct pending_stop Date: Fri, 24 Apr 2026 21:45:04 +0100 Message-ID: <20260424204508.1343973-25-pedro@palves.net> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260424204508.1343973-1-pedro@palves.net> References: <20260424204508.1343973-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 After the previous patches, struct pending_stop only contains one field. So move that field into the windows_thread_info structure directly, and eliminate struct pending_stop. Approved-By: Tom Tromey Change-Id: I7955884b3f378d8b39b908f6252d215f6568b367 commit-id:fb68c808 --- gdb/nat/windows-nat.h | 21 ++++++++------------- gdb/windows-nat.c | 14 +++++++------- gdbserver/win32-low.cc | 12 ++++++------ 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index cb7456c624e..5258ce52a0f 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -38,16 +38,6 @@ namespace windows_nat { -/* Info about a potential pending stop. Each thread holds one of - these. See "windows_thread_info::pending_stop" for more - information. */ -struct pending_stop -{ - /* The target waitstatus we computed. TARGET_WAITKIND_IGNORE if the - thread does not have a pending stop. */ - target_waitstatus status; -}; - struct windows_process_info; /* Thread information structure used to track extra information about @@ -111,9 +101,14 @@ struct windows_thread_info queues the stop events. However, this can result in the strange effect of trying to single step thread A -- leaving all other threads suspended -- and then seeing a stop in thread B. To handle - this scenario, we queue all such "pending" stops here, and then - process them once the step has completed. See PR gdb/22992. */ - struct pending_stop pending_stop {}; + this scenario, we queue the "pending" stop here, and then + process it once the step has completed. See PR gdb/22992. + If we do have a pending event, its Windows event info is in + LAST_EVENT. + + TARGET_WAITKIND_IGNORE if the thread does not have a pending + stop. */ + target_waitstatus pending_status; /* The last Windows event returned by WaitForDebugEvent for this thread. */ diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 062ecf1e063..e0589c4de97 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -727,7 +727,7 @@ windows_nat_target::windows_continue (DWORD continue_status, int id, { if ((id == -1 || id == (int) th->tid) && !th->suspended - && th->pending_stop.status.kind () != TARGET_WAITKIND_IGNORE) + && th->pending_status.kind () != TARGET_WAITKIND_IGNORE) { DEBUG_EVENTS ("got matching pending stop event " "for 0x%x, not resuming", @@ -923,18 +923,18 @@ windows_nat_target::get_windows_debug_event DWORD thread_id = 0; /* If there is a relevant pending stop, report it now. See the - comment by the definition of "windows_thread_info::pending_stop" + comment by the definition of "windows_thread_info::pending_status" for details on why this is needed. */ for (auto &th : windows_process->thread_list) { if (!th->suspended - && th->pending_stop.status.kind () != TARGET_WAITKIND_IGNORE) + && th->pending_status.kind () != TARGET_WAITKIND_IGNORE) { DEBUG_EVENTS ("reporting pending event for 0x%x", th->tid); thread_id = th->tid; - *ourstatus = th->pending_stop.status; - th->pending_stop.status.set_ignore (); + *ourstatus = th->pending_status; + th->pending_status.set_ignore (); *current_event = th->last_event; ptid_t ptid (windows_process->process_id, thread_id); @@ -1159,7 +1159,7 @@ windows_nat_target::get_windows_debug_event if (th->suspended) { /* Pending stop. See the comment by the definition of - "pending_stops" for details on why this is needed. */ + "pending_status" for details on why this is needed. */ DEBUG_EVENTS ("get_windows_debug_event - " "unexpected stop in suspended thread 0x%x", thread_id); @@ -1172,7 +1172,7 @@ windows_nat_target::get_windows_debug_event th->pc_adjusted = false; } - th->pending_stop.status = *ourstatus; + th->pending_status = *ourstatus; ourstatus->set_ignore (); continue_last_debug_event_main_thread diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc index 0741dd24ed5..e712033898c 100644 --- a/gdbserver/win32-low.cc +++ b/gdbserver/win32-low.cc @@ -814,7 +814,7 @@ win32_process_target::resume (thread_resume *resume_info, size_t n) } if (!th->suspended - && th->pending_stop.status.kind () != TARGET_WAITKIND_IGNORE) + && th->pending_status.kind () != TARGET_WAITKIND_IGNORE) any_pending = true; }); @@ -957,10 +957,10 @@ get_child_debug_event (DWORD *continue_status, auto *th = static_cast (thread.target_data ()); if (!th->suspended - && th->pending_stop.status.kind () != TARGET_WAITKIND_IGNORE) + && th->pending_status.kind () != TARGET_WAITKIND_IGNORE) { - *ourstatus = th->pending_stop.status; - th->pending_stop.status.set_ignore (); + *ourstatus = th->pending_status; + th->pending_status.set_ignore (); *current_event = th->last_event; ptid = debug_event_ptid (current_event); switch_to_thread (find_thread_ptid (ptid)); @@ -1120,13 +1120,13 @@ get_child_debug_event (DWORD *continue_status, if (th != nullptr && th->suspended) { /* Pending stop. See the comment by the definition of - "windows_thread_info::pending_stop" for details on why this + "windows_thread_info::pending_status" for details on why this is needed. */ OUTMSG2 (("get_windows_debug_event - " "unexpected stop in suspended thread 0x%x\n", th->tid)); maybe_adjust_pc (*current_event); - th->pending_stop.status = *ourstatus; + th->pending_status = *ourstatus; ourstatus->set_spurious (); } else -- 2.53.0