From patchwork Tue May 7 23:42:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 89702 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B483C386F81C for ; Tue, 7 May 2024 23:47:29 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by sourceware.org (Postfix) with ESMTPS id 8DFC0384AB7F for ; Tue, 7 May 2024 23:43:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8DFC0384AB7F 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 8DFC0384AB7F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715125417; cv=none; b=yGOptxXPpsrY8LPEjOLGGjN9jIniKiDwKbc9deZ9mThRHyhT7cD3n0yiy+ZWvlsMghWtyMKQMPGSyR9cY7bLz47uJwfKT9F+YSOkyJn6VwMHgM4AsnGd2EOiZ24v/zlxAK/FAvEQCtzt/q1dhliGg3RrxnhS61W7+W7/VT4A3gw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715125417; c=relaxed/simple; bh=qmH5yQ6JuJE82wyct6g1d1w9xEiiXPanVLZe/VzToR0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=hDziIP+iIT+GZJxU2FuvN0J9awZkF0Fa+cnTzZwiN9nGoFR4RVtv4KzpguIQvUKtv6ZnNgRlvZjb1QdBaVo70r6MoiXrw+R1MSTPeSbIKA/YAnRFfCJqZiqjeeWXRIzZeOXS56htrHZ05zyKSwG0k2ZAwNGQDc0JHYHWyuSS0Yg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-41b7a26326eso27594205e9.3 for ; Tue, 07 May 2024 16:43:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715125413; x=1715730213; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IOySwSlkBckKbFvK/4QK5UetF5LAWzJ455U4phwssro=; b=PlBhW+kB2vFPlm0gpTYJftLOobvWJtSgmsKceQ6w7okT21XS9pi/IsBgx68rfaGEFB e1/zgE+g61Na2oDVKjuHExGQmwU/EcXv9Pg+XiltsFJW6bA+2LL1iO4I9Z4X3ZTWxT9r zF9DLeFIi5yZfCG00IoYBK7gBJ1SNtQAzHQcbMFDLwMZF0j9k6BwoXEnmtRKzx4xUBqy Dlf+BPst2p7ZYlZp4k2YpMkspcVf+Qh4eSotcik5dq3IH912FK6ab8dLMK3qH2lskKY3 ZdWa1NDyXcJc8UCbvjRFI1nBjjB1fZapd9RlztM58O3519o3zfa660f7pLJ191SdDWpC tz0Q== X-Gm-Message-State: AOJu0YxQmt/J8+TvonGO0mKH9LT0degZlW70RkUeCTV6nq5It0YbtxoM 1vvzX1mwK+3Foj3zL+3f/YEav+ugOfjbfvtk3NZM4SPx2g/eTIXzphF7EqLH X-Google-Smtp-Source: AGHT+IEqx6p/N3OpWvdqI0g38lYViDYuUV+M9emSHFXWf6M8GQAI154G9tk8+7fKqlRhTPNDXa3+TA== X-Received: by 2002:a05:600c:1c24:b0:418:969b:cb37 with SMTP id 5b1f17b1804b1-41f72593d94mr7412145e9.39.1715125413271; Tue, 07 May 2024 16:43:33 -0700 (PDT) Received: from localhost ([2001:8a0:f908:4900:2dd1:1a0d:2b75:dc42]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-41f87c235e2sm1982645e9.12.2024.05.07.16.43.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 May 2024 16:43:32 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 16/34] Windows gdb+gdbserver: Introduce get_last_debug_event_ptid Date: Wed, 8 May 2024 00:42:15 +0100 Message-ID: <20240507234233.371123-17-pedro@palves.net> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240507234233.371123-1-pedro@palves.net> References: <20240507234233.371123-1-pedro@palves.net> MIME-Version: 1.0 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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+patchwork=sourceware.org@sourceware.org This will be used in subsequent patches to avoid using DBG_EXCEPTION_NOT_HANDLED on the wrong thread. Change-Id: I32915623b5036fb902f9830ce2d6f0b1ccf1f5cf --- 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 a01d7b3c0c0..7f8834facd4 100644 --- a/gdb/nat/windows-nat.c +++ b/gdb/nat/windows-nat.c @@ -666,6 +666,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 c268a12fd8f..70912fd6210 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -253,6 +253,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. */