From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wZSeNJ/W62m5UzkAWB0awg (envelope-from ) for ; Fri, 24 Apr 2026 16:46:23 -0400 Received: by simark.ca (Postfix, from userid 112) id D53EE1E0BA; Fri, 24 Apr 2026 16:46: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=-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 7CF591E093 for ; Fri, 24 Apr 2026 16:46:23 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 5CB9D4BB8F5E for ; Fri, 24 Apr 2026 20:46:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5CB9D4BB8F5E Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by sourceware.org (Postfix) with ESMTPS id 2F8694BB8F47 for ; Fri, 24 Apr 2026 20:45:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2F8694BB8F47 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 2F8694BB8F47 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777063559; cv=none; b=XfHRbyN/UlamREVpH+7MRjMTZkpfod+pUhYgZjoPktP34PpdHp7fcwGMJlIaRvSCam+g1IM6Hj7JSibuXLRDvcMgNjDwhCRaG4dqVHGeoetcxZTlcSsiwLFrwFIoSfFTL/IvTmw8LFrlfhQekSAthnJidMhTlvHzPtbo1oVQi5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777063559; c=relaxed/simple; bh=Tnj/wgYsE74QzLoB7S+rCwvBp3gVSBmCWbwoK0D6bxQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=pw4As1AJEYLwl1D0jIw7tYG6t1RXzozdLn2KKXEghu6EWtkHqbVhb3b2GY4EqYKDLSHJE5AJqdTGeCairqEc2NHvG8d8d57ObX4PEul/hkxiuz47gmczPuPYQ/pJOSp/vU7AjcE6yZaC5tpvzV2UOk3nw8+Bd8p74RJYuGFaxKU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F8694BB8F47 Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-488a14c31eeso66480525e9.0 for ; Fri, 24 Apr 2026 13:45:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777063558; x=1777668358; 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=Aui7JQASb9CFdCpravPH1SHo+EUNB/719KWQcwiyJ+Y=; b=DYh2T/2tDj77PbXOXeMnlyrRBs2LEYKWBV9v+4BQwpjkedMs7m5qukF6n6DJa5ReB/ RLcgkgkhMl3lOib1H8+wM1J7g5so3JpfOugLsfg9USqbWZm5WWj8l0KrpketkumL+1Vu 4V6iX8v2oSKp5gezj0hqFsT8yYOLZ1GtQlrIeLG6vaBaJduVMB6KcZ+M0oVQTTADkm4z 2JmsMd69fdkNPzbnMZ1jmgsavOdemkQjwl6TWWXWpFTdQJt+Ey44DYOk8zkeuOHq0Ekm fmK7GQVTN+pm9wL8UBibvL8xjiFwwT/gjRRpL9ntgnvJ+tw4txSABxuD9FoJJyqanzNr LfVg== X-Gm-Message-State: AOJu0YyeB+k6USXGy01wA9bdCXQ6aSLYotr/rkRnqwFAlszImHiMPGkU TineUlHONTy0sGn36WWrKZwfooRe/FPY5HexqqAULWii9iyOhT5rXNPLU/Mulk6b X-Gm-Gg: AeBDieu8t/IAAMpOhJ+uCGTPA87Xl18EpY5+uav2AiZetAjoFtUanEY1zm7nvOdREMy HUrJ1SB5b0d1o27TgQYQKI3H/XYtfQvJvGE0hNK2HJfXTNIuuKHKLkKP/FWK0FewXO4md13ecqg Yt7whmIT1ASwOlXO8oAguyqURLkq1kCVFKp0TULVsti9wAv7XBAS1gopNv5Mcn25YKZm2rvPMtD NJ9F01bQoiamXfqqEwHCECYiHeaJYjy6+6cJZ1dEsSzEKH+USx01lpIndgTPlCcR94dkLKrZcAa R/Eyuvy9eK9TSAEjidmr3q4Cx+zoCOVL0ml4a+Y/R/6ysBhx4ZMuAqvOanzVVgDKilofMTHg/2a vLdqudbENh1ERSe4QbELqrLgVbSALv4yGjc1Rpn0dBKFoJ3zLu5yeqYAsDl9vvYeUmA2pWjHK1o Mr8xd33IIIOLXK26QXRLpLwI9e6jZwMXsz X-Received: by 2002:a05:600c:1d22:b0:48a:6798:52e9 with SMTP id 5b1f17b1804b1-48a6798548fmr37310755e9.0.1777063557778; Fri, 24 Apr 2026 13:45:57 -0700 (PDT) Received: from localhost ([2001:8a0:facb:a800:7315:8865:c664:fc06]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-489e124f6c7sm113932285e9.29.2026.04.24.13.45.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Apr 2026 13:45:57 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed 14/28] Windows gdb+gdbserver: Introduce get_last_debug_event_ptid Date: Fri, 24 Apr 2026 21:44:54 +0100 Message-ID: <20260424204508.1343973-15-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 This will be used in subsequent patches to avoid using DBG_EXCEPTION_NOT_HANDLED on the wrong thread. Approved-By: Tom Tromey Change-Id: I32915623b5036fb902f9830ce2d6f0b1ccf1f5cf commit-id:1cf51152 --- gdb/nat/windows-nat.c | 8 ++++++++ gdb/nat/windows-nat.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c index cf173295517..11151fdc28a 100644 --- a/gdb/nat/windows-nat.c +++ b/gdb/nat/windows-nat.c @@ -642,6 +642,14 @@ windows_process_info::add_all_dlls () /* See nat/windows-nat.h. */ +ptid_t +get_last_debug_event_ptid () +{ + return ptid_t (last_wait_event.dwProcessId, last_wait_event.dwThreadId, 0); +} + +/* See nat/windows-nat.h. */ + BOOL continue_last_debug_event (DWORD continue_status, bool debug_events) { diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index 075d3858350..8d97ecc4cb6 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -278,6 +278,11 @@ struct windows_process_info extern BOOL continue_last_debug_event (DWORD continue_status, bool debug_events); +/* Return the ptid_t of the thread that the last waited-for event was + for. */ + +extern ptid_t get_last_debug_event_ptid (); + /* A simple wrapper for WaitForDebugEvent that also sets the internal 'last_wait_event' on success. */ -- 2.53.0