diff options
author | Pedro Alves <pedro@palves.net> | 2024-05-07 16:04:50 +0100 |
---|---|---|
committer | Pedro Alves <pedro@palves.net> | 2024-05-10 11:25:59 +0100 |
commit | 3f6f23ee4e943f92ed7e52c875076bdaeb70f93b (patch) | |
tree | db94e7d3bbd217d3dc577cdf7a61a46f1bee9b62 /gdb/x86-tdep.c | |
parent | 734404845dfd245e26ea900bba84555e8baf09ae (diff) | |
download | gdb-3f6f23ee4e943f92ed7e52c875076bdaeb70f93b.zip gdb-3f6f23ee4e943f92ed7e52c875076bdaeb70f93b.tar.gz gdb-3f6f23ee4e943f92ed7e52c875076bdaeb70f93b.tar.bz2 |
Windows gdb+gdbserver: Elim desired_stop_thread_id / rework pending_stops
windows_process.desired_stop_thread_id doesn't work for non-stop, as
in that case every thread will have its own independent
WaitForDebugEvent event.
Instead, detect whether we have been reported a stop that was not
supposed to be reported by simply checking whether the thread that is
reporting the event is suspended. This is now easilly possible since
each thread's suspend state is kept in sync with whether infrun wants
the thread executing or not.
windows_process.desired_stop_thread_id was also used as thread to pass
to windows_continue. However, we don't really need that either.
windows_continue is used to update the thread's registers, unsuspend
them, and then finally call ContinueDebugEvent. In most cases, we
only need the ContinueDebugEvent step, so we can convert the
windows_continue calls to continue_last_debug_event_main_thread calls.
The exception is when we see a thread creation event -- in that case,
we need to update the debug registers of the new thread. We can use
continue_one_thread for that.
Since the pending stop is now stored in windows_thread_info,
get_windows_debug_event needs to avoid reaching the bottom code if
there's no thread associated with the event anymore (i.e.,
EXIT_THREAD_DEBUG_EVENT / EXIT_PROCESS_DEBUG_EVENT).
I considered whether it would be possible to keep the pending_stop
handling code shared in gdb/nat/windows-nat.c, in this patch and
throughout the series, but I conclused that it isn't worth it, until
gdbserver is taught about async and non-stop as well.
The pending_stop struct will eventually be eliminated later down the
series.
Change-Id: Ib7c8e8d16edc0900b7c411976c5d70cf93931c1c
Diffstat (limited to 'gdb/x86-tdep.c')
0 files changed, 0 insertions, 0 deletions