gdbserver: replace direct assignments to current_thread
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Mon, 13 Dec 2021 11:22:48 +0000 (12:22 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Mon, 13 Dec 2021 11:22:48 +0000 (12:22 +0100)
commit24583e45efc823c1a9ea009dfddc36f9b74dcbcd
treeac00cde441192c880eee0f36a7e4346e0ba53c58
parentf24791b72e764ada576901c0e866bf7768773a16
gdbserver: replace direct assignments to current_thread

Replace the direct assignments to current_thread with
switch_to_thread.  Use scoped_restore_current_thread when appropriate.
There is one instance remaining in linux-low.cc's wait_for_sigstop.
This will be handled in a separate patch.

Regression-tested on X86-64 Linux using the native-gdbserver and
native-extended-gdbserver board files.
13 files changed:
gdbserver/inferiors.cc
gdbserver/linux-low.cc
gdbserver/linux-x86-low.cc
gdbserver/mem-break.cc
gdbserver/netbsd-low.cc
gdbserver/proc-service.cc
gdbserver/regcache.cc
gdbserver/remote-utils.cc
gdbserver/server.cc
gdbserver/target.cc
gdbserver/thread-db.cc
gdbserver/tracepoint.cc
gdbserver/win32-low.cc