diff options
author | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2021-12-13 12:22:48 +0100 |
---|---|---|
committer | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2021-12-13 12:22:48 +0100 |
commit | 24583e45efc823c1a9ea009dfddc36f9b74dcbcd (patch) | |
tree | ac00cde441192c880eee0f36a7e4346e0ba53c58 /gdbserver/target.cc | |
parent | f24791b72e764ada576901c0e866bf7768773a16 (diff) | |
download | gdb-24583e45efc823c1a9ea009dfddc36f9b74dcbcd.zip gdb-24583e45efc823c1a9ea009dfddc36f9b74dcbcd.tar.gz gdb-24583e45efc823c1a9ea009dfddc36f9b74dcbcd.tar.bz2 |
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.
Diffstat (limited to 'gdbserver/target.cc')
-rw-r--r-- | gdbserver/target.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdbserver/target.cc b/gdbserver/target.cc index aa3d424..bfafb7c 100644 --- a/gdbserver/target.cc +++ b/gdbserver/target.cc @@ -35,7 +35,7 @@ set_desired_thread () client_state &cs = get_client_state (); thread_info *found = find_thread_ptid (cs.general_thread); - current_thread = found; + switch_to_thread (found); return (current_thread != NULL); } @@ -101,7 +101,7 @@ prepare_to_access_memory (void) return 1; } - current_thread = thread; + switch_to_thread (thread); cs.general_thread = ptid_of (thread); return 0; |