]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
windows: Don't use current_thread for register fetch/store
authorSimon Marchi <simon.marchi@ericsson.com>
Mon, 6 Mar 2017 19:32:52 +0000 (14:32 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Tue, 7 Mar 2017 15:52:47 +0000 (10:52 -0500)
commit3c830b412ff85ca0662c8ed98311a9cee6895a81
tree145fe0686741f996ff9107cd88414fa825a96334
parentd274ecf4ddf76768af57e27f654b9ce6784b391c
windows: Don't use current_thread for register fetch/store

The windows_fetch_inferior_registers function sets current_thread then
calls do_windows_fetch_inferior_registers, which reads current_thread.
This very much looks like passing a parameter through a global variable.
I think it would be more straightforward to pass the thread as a
parameter.

It will also fit better with the following patches, which pass a ptid to
the register fetch/store target methods.

I don't have access to a Windows development environment, so I couldn't
even build-test this.  Could somebody try it to make sure it doesn't
break everything?

gdb/ChangeLog:

* windows-nat.c (do_windows_fetch_inferior_registers): Add
windows_thread_info parameter and use it instead of
current_thread.
(windows_fetch_inferior_registers): Don't set current_thread,
pass the thread to do_windows_fetch_inferior_registers.
(do_windows_store_inferior_registers): Add windows_thread_info
parameter and use it instead of current_thread.
(windows_store_inferior_registers): Don't set current_thread,
pass the thread to do_windows_store_inferior_registers.
gdb/windows-nat.c