mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
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.
This commit is contained in:
@@ -1099,7 +1099,6 @@ prepare_resume_reply (char *buf, ptid_t ptid, const target_waitstatus &status)
|
||||
case TARGET_WAITKIND_SYSCALL_ENTRY:
|
||||
case TARGET_WAITKIND_SYSCALL_RETURN:
|
||||
{
|
||||
struct thread_info *saved_thread;
|
||||
const char **regp;
|
||||
struct regcache *regcache;
|
||||
|
||||
@@ -1182,7 +1181,7 @@ prepare_resume_reply (char *buf, ptid_t ptid, const target_waitstatus &status)
|
||||
|
||||
buf += strlen (buf);
|
||||
|
||||
saved_thread = current_thread;
|
||||
scoped_restore_current_thread restore_thread;
|
||||
|
||||
switch_to_thread (the_target, ptid);
|
||||
|
||||
@@ -1273,8 +1272,6 @@ prepare_resume_reply (char *buf, ptid_t ptid, const target_waitstatus &status)
|
||||
buf += strlen (buf);
|
||||
current_process ()->dlls_changed = false;
|
||||
}
|
||||
|
||||
current_thread = saved_thread;
|
||||
}
|
||||
break;
|
||||
case TARGET_WAITKIND_EXITED:
|
||||
|
||||
Reference in New Issue
Block a user