aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2023-05-11 12:27:27 +0100
committerPedro Alves <pedro@palves.net>2026-04-24 21:28:44 +0100
commit898afc7976ac09b9dfc49a13140bdae23b3eb988 (patch)
treeaaad934e5de1ff0781aa6ee1a8093cccfe92f43a
parente1c7509c93a8d649b8f33f8b8822d287d101c521 (diff)
downloadbinutils-898afc7976ac09b9dfc49a13140bdae23b3eb988.tar.gz
binutils-898afc7976ac09b9dfc49a13140bdae23b3eb988.tar.bz2
binutils-898afc7976ac09b9dfc49a13140bdae23b3eb988.zip
Windows gdb+gdbserver: Introduce get_last_debug_event_ptid
This will be used in subsequent patches to avoid using DBG_EXCEPTION_NOT_HANDLED on the wrong thread. Approved-By: Tom Tromey <tom@tromey.com> Change-Id: I32915623b5036fb902f9830ce2d6f0b1ccf1f5cf commit-id:1cf51152
-rw-r--r--gdb/nat/windows-nat.c8
-rw-r--r--gdb/nat/windows-nat.h5
2 files changed, 13 insertions, 0 deletions
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 @@ private:
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. */