diff options
Diffstat (limited to 'gdb/sol-thread.c')
-rw-r--r-- | gdb/sol-thread.c | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index e59c0cb..7c1620a 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -872,19 +872,13 @@ ps_ptwrite (gdb_ps_prochandle_t ph, gdb_ps_addr_t addr, ps_err_e ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset) { - struct cleanup *old_chain; - struct regcache *regcache; - - old_chain = save_inferior_ptid (); - - inferior_ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); - regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ()); + ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); + struct regcache *regcache + = get_thread_arch_regcache (ptid, target_gdbarch ()); target_fetch_registers (regcache, -1); fill_gregset (regcache, (gdb_gregset_t *) gregset, -1); - do_cleanups (old_chain); - return PS_OK; } @@ -894,19 +888,13 @@ ps_err_e ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset) { - struct cleanup *old_chain; - struct regcache *regcache; - - old_chain = save_inferior_ptid (); - - inferior_ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); - regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ()); + ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); + struct regcache *regcache + = get_thread_arch_regcache (ptid, target_gdbarch ()); supply_gregset (regcache, (const gdb_gregset_t *) gregset); target_store_registers (regcache, -1); - do_cleanups (old_chain); - return PS_OK; } @@ -952,19 +940,13 @@ ps_err_e ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prfpregset_t *fpregset) { - struct cleanup *old_chain; - struct regcache *regcache; - - old_chain = save_inferior_ptid (); - - inferior_ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); - regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ()); + ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); + struct regcache *regcache + = get_thread_arch_regcache (ptid, target_gdbarch ()); target_fetch_registers (regcache, -1); fill_fpregset (regcache, (gdb_fpregset_t *) fpregset, -1); - do_cleanups (old_chain); - return PS_OK; } @@ -974,19 +956,13 @@ ps_err_e ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prfpregset_t * fpregset) { - struct cleanup *old_chain; - struct regcache *regcache; - - old_chain = save_inferior_ptid (); - - inferior_ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); - regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ()); + ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0); + struct regcache *regcache + = get_thread_arch_regcache (ptid, target_gdbarch ()); supply_fpregset (regcache, (const gdb_fpregset_t *) fpregset); target_store_registers (regcache, -1); - do_cleanups (old_chain); - return PS_OK; } |