aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/linux-x86-low.cc
diff options
context:
space:
mode:
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2021-12-13 12:22:48 +0100
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2021-12-13 12:22:48 +0100
commit24583e45efc823c1a9ea009dfddc36f9b74dcbcd (patch)
treeac00cde441192c880eee0f36a7e4346e0ba53c58 /gdbserver/linux-x86-low.cc
parentf24791b72e764ada576901c0e866bf7768773a16 (diff)
downloadgdb-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/linux-x86-low.cc')
-rw-r--r--gdbserver/linux-x86-low.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc
index 58ca4ba..4955bd3 100644
--- a/gdbserver/linux-x86-low.cc
+++ b/gdbserver/linux-x86-low.cc
@@ -991,7 +991,7 @@ x86_linux_read_description (void)
void
x86_target::update_xmltarget ()
{
- struct thread_info *saved_thread = current_thread;
+ scoped_restore_current_thread restore_thread;
/* Before changing the register cache's internal layout, flush the
contents of the current valid caches back to the threads, and
@@ -1002,12 +1002,10 @@ x86_target::update_xmltarget ()
int pid = proc->pid;
/* Look up any thread of this process. */
- current_thread = find_any_thread_of_pid (pid);
+ switch_to_thread (find_any_thread_of_pid (pid));
low_arch_setup ();
});
-
- current_thread = saved_thread;
}
/* Process qSupported query, "xmlRegisters=". Update the buffer size for