diff options
author | Pedro Alves <pedro@palves.net> | 2023-05-08 21:36:28 +0100 |
---|---|---|
committer | Pedro Alves <pedro@palves.net> | 2024-05-08 00:39:55 +0100 |
commit | c151e663fad2297d1cf21ce4e4143dc5a3eb0f96 (patch) | |
tree | dadd9b181c6628f30e0a3da2937de90cd6ec84e1 /gdbserver | |
parent | 78ef7c48d1d0c8199cb55e8c6f6a3e6ff09ee59f (diff) | |
download | fsf-binutils-gdb-c151e663fad2297d1cf21ce4e4143dc5a3eb0f96.zip fsf-binutils-gdb-c151e663fad2297d1cf21ce4e4143dc5a3eb0f96.tar.gz fsf-binutils-gdb-c151e663fad2297d1cf21ce4e4143dc5a3eb0f96.tar.bz2 |
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.
Change-Id: I8d2f0a749d23329956e62362a7007189902dddb5
Diffstat (limited to 'gdbserver')
-rw-r--r-- | gdbserver/win32-low.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc index 5d3ad38..b693da5 100644 --- a/gdbserver/win32-low.cc +++ b/gdbserver/win32-low.cc @@ -463,8 +463,8 @@ child_fetch_inferior_registers (struct regcache *regcache, int r) { int regno; windows_thread_info *th - = windows_process.thread_rec (current_thread_ptid (), - INVALIDATE_CONTEXT); + = windows_process.find_thread (current_thread_ptid ()); + win32_require_context (th); if (r == -1 || r > NUM_REGS) child_fetch_inferior_registers (regcache, NUM_REGS); else @@ -479,8 +479,8 @@ child_store_inferior_registers (struct regcache *regcache, int r) { int regno; windows_thread_info *th - = windows_process.thread_rec (current_thread_ptid (), - INVALIDATE_CONTEXT); + = windows_process.find_thread (current_thread_ptid ()); + win32_require_context (th); if (r == -1 || r == 0 || r > NUM_REGS) child_store_inferior_registers (regcache, NUM_REGS); else |