]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Windows gdb+gdbserver: Introduce get_last_debug_event_ptid
authorPedro Alves <pedro@palves.net>
Thu, 11 May 2023 11:27:27 +0000 (12:27 +0100)
committerPedro Alves <pedro@palves.net>
Mon, 9 Jun 2025 17:09:13 +0000 (18:09 +0100)
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
gdb/nat/windows-nat.h

index fbb48f8e3eed83a1087e62da56674f21309dfad0..fe707fff9051df11f323f9731fb859c4da24bece 100644 (file)
@@ -637,6 +637,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)
 {
index fec6becb594f7320561f93131efb1fc7bf0db675..8ac16311650a5edbbf35d0838f578ec875f473ee 100644 (file)
@@ -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.  */