]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Windows gdb+gdbserver: Eliminate thread_rec(INVALIDATE_CONTEXT) calls
authorPedro Alves <pedro@palves.net>
Mon, 8 May 2023 20:36:28 +0000 (21:36 +0100)
committerPedro Alves <pedro@palves.net>
Mon, 19 May 2025 13:12:37 +0000 (14:12 +0100)
commitb006068cc5631a0f881d7d764d6aa2f5c0255793
treec71ccb31ba74a510f1b1e58da4b44e9395d88f1a
parent197deb7f22c53da3ff167c484fbb779b259b5f9d
Windows gdb+gdbserver: Eliminate thread_rec(INVALIDATE_CONTEXT) calls

Replace thread_rec(INVALIDATE_CONTEXT) calls with find_thread, and
invalidate_context / suspend calls in the spots that might need those.

I don't know why does the INVALIDATE_CONTEXT implementation in GDB
avoid suspending the event thread:

case INVALIDATE_CONTEXT:
  if (ptid.lwp () != current_event.dwThreadId)
    th->suspend ();

Checks for a global "current_event" get in the way of non-stop support
later in the series, as each thread will have its own "last debug
event".  Regardless, it should be fine to suspend the event thread.
As a data point, the GDBserver implementation always suspends.  So
this patch does not try to avoid suspending the event thread on the
native side either.

Approved-By: Tom Tromey <tom@tromey.com>
Change-Id: I8d2f0a749d23329956e62362a7007189902dddb5
gdb/nat/windows-nat.h
gdb/windows-nat.c
gdbserver/win32-low.cc