]> 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>
Fri, 24 Apr 2026 20:28:44 +0000 (21:28 +0100)
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

gdb/nat/windows-nat.c
gdb/nat/windows-nat.h

index cf173295517b21d864b72b2e9b511879c90695ce..11151fdc28a1c7158997619b13573af74d3839d4 100644 (file)
@@ -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)
 {
index 075d38583502d5266e96b029904844a66b9ca39b..8d97ecc4cb680895ee46f46b33604b4942995d26 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.  */