diff options
author | Pedro Alves <palves@redhat.com> | 2020-06-18 21:28:35 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2020-06-18 23:17:01 +0100 |
commit | 50838d1be72ddd30e0b5f081933482424ae5a6b0 (patch) | |
tree | cd02b16ad56827c891755a03fa64a2b1ac10309f /gdb/nat | |
parent | 31ce04e9e0ce96e752e2c53dfad5881d24e9f080 (diff) | |
download | gdb-50838d1be72ddd30e0b5f081933482424ae5a6b0.zip gdb-50838d1be72ddd30e0b5f081933482424ae5a6b0.tar.gz gdb-50838d1be72ddd30e0b5f081933482424ae5a6b0.tar.bz2 |
Don't write to inferior_ptid in windows-nat.c, part II
Writing to inferior_ptid in
windows_nat_target::get_windows_debug_event is just incorrect and not
necessary. We'll report the event to GDB's core, which then takes
care of switching inferior_ptid / current thread.
Related (see windows_nat_target::get_windows_debug_event), there's
also a "current_windows_thread" global that is just begging to get out
of sync with core GDB's current thread. This patch removes it.
gdbserver already does not have an equivalent global in win32-low.cc.
gdb/ChangeLog:
2020-06-18 Pedro Alves <palves@redhat.com>
* nat/windows-nat.c (current_windows_thread): Remove.
* nat/windows-nat.h (current_windows_thread): Remove.
* windows-nat.c (windows_nat_target::stopped_by_sw_breakpoint):
Adjust.
(display_selectors): Adjust to fetch the current
windows_thread_info based on inferior_ptid.
(fake_create_process): No longer write to current_windows_thread.
(windows_nat_target::get_windows_debug_event):
Don't set inferior_ptid or current_windows_thread.
(windows_nat_target::wait): Adjust to not rely on
current_windows_thread.
(do_initial_windows_stuff): Now a method of windows_nat_target.
Switch to the last_ptid thread.
(windows_nat_target::attach): Adjust.
(windows_nat_target::detach): Use switch_to_no_thread instead of
writing to inferior_ptid directly.
(windows_nat_target::create_inferior): Adjust.
Diffstat (limited to 'gdb/nat')
-rw-r--r-- | gdb/nat/windows-nat.c | 1 | ||||
-rw-r--r-- | gdb/nat/windows-nat.h | 3 |
2 files changed, 0 insertions, 4 deletions
diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c index 709a9d3..be6db97 100644 --- a/gdb/nat/windows-nat.c +++ b/gdb/nat/windows-nat.c @@ -36,7 +36,6 @@ DEBUG_EVENT current_event; ContinueDebugEvent. */ static DEBUG_EVENT last_wait_event; -windows_thread_info *current_windows_thread; DWORD desired_stop_thread_id = -1; std::vector<pending_stop> pending_stops; EXCEPTION_RECORD siginfo_er; diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index 80c652b..f742db2 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -180,9 +180,6 @@ extern enum gdb_signal last_sig; stop. */ extern DEBUG_EVENT current_event; -/* Info on currently selected thread */ -extern windows_thread_info *current_windows_thread; - /* The ID of the thread for which we anticipate a stop event. Normally this is -1, meaning we'll accept an event in any thread. */ |