/* libthread_db helper functions for the remote server for GDB.
- Copyright (C) 2002-2020 Free Software Foundation, Inc.
+ Copyright (C) 2002-2021 Free Software Foundation, Inc.
Contributed by MontaVista Software.
gregset_info (void)
{
int i = 0;
- const struct regs_info *regs_info = (*the_low_target.regs_info) ();
+ const regs_info *regs_info = the_linux_target->get_regs_info ();
struct regsets_info *regsets_info = regs_info->regsets_info;
while (regsets_info->regsets[i].size != -1)
{
#ifdef HAVE_REGSETS
struct lwp_info *lwp;
- struct thread_info *reg_thread, *saved_thread;
struct regcache *regcache;
lwp = find_lwp_pid (ptid_t (lwpid));
if (lwp == NULL)
return PS_ERR;
- reg_thread = get_lwp_thread (lwp);
- saved_thread = current_thread;
- current_thread = reg_thread;
+ scoped_restore_current_thread restore_thread;
+ switch_to_thread (get_lwp_thread (lwp));
regcache = get_thread_regcache (current_thread, 1);
gregset_info ()->fill_function (regcache, gregset);
- current_thread = saved_thread;
return PS_OK;
#else
return PS_ERR;