2007-09-12 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gdb / proc-service.c
index d38ade538bb60f2bda071d97d8d6cc716b202cbb..6ea25702b97bc9ed8f9d4c41c4fd89dbc60f9e97 100644 (file)
@@ -6,7 +6,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -15,9 +15,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 
@@ -257,11 +255,13 @@ ps_err_e
 ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
 {
   struct cleanup *old_chain = save_inferior_ptid ();
+  struct regcache *regcache;
 
   inferior_ptid = BUILD_LWP (lwpid, ph->pid);
+  regcache = get_thread_regcache (inferior_ptid);
 
-  target_fetch_registers (current_regcache, -1);
-  fill_gregset (current_regcache, (gdb_gregset_t *) gregset, -1);
+  target_fetch_registers (regcache, -1);
+  fill_gregset (regcache, (gdb_gregset_t *) gregset, -1);
 
   do_cleanups (old_chain);
   return PS_OK;
@@ -274,11 +274,13 @@ ps_err_e
 ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset)
 {
   struct cleanup *old_chain = save_inferior_ptid ();
+  struct regcache *regcache;
 
   inferior_ptid = BUILD_LWP (lwpid, ph->pid);
+  regcache = get_thread_regcache (inferior_ptid);
 
-  supply_gregset (current_regcache, (const gdb_gregset_t *) gregset);
-  target_store_registers (current_regcache, -1);
+  supply_gregset (regcache, (const gdb_gregset_t *) gregset);
+  target_store_registers (regcache, -1);
 
   do_cleanups (old_chain);
   return PS_OK;
@@ -292,11 +294,13 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
               gdb_prfpregset_t *fpregset)
 {
   struct cleanup *old_chain = save_inferior_ptid ();
+  struct regcache *regcache;
 
   inferior_ptid = BUILD_LWP (lwpid, ph->pid);
+  regcache = get_thread_regcache (inferior_ptid);
 
-  target_fetch_registers (current_regcache, -1);
-  fill_fpregset (current_regcache, (gdb_fpregset_t *) fpregset, -1);
+  target_fetch_registers (regcache, -1);
+  fill_fpregset (regcache, (gdb_fpregset_t *) fpregset, -1);
 
   do_cleanups (old_chain);
   return PS_OK;
@@ -310,11 +314,13 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
               const gdb_prfpregset_t *fpregset)
 {
   struct cleanup *old_chain = save_inferior_ptid ();
+  struct regcache *regcache;
 
   inferior_ptid = BUILD_LWP (lwpid, ph->pid);
+  regcache = get_thread_regcache (inferior_ptid);
 
-  supply_fpregset (current_regcache, (const gdb_fpregset_t *) fpregset);
-  target_store_registers (current_regcache, -1);
+  supply_fpregset (regcache, (const gdb_fpregset_t *) fpregset);
+  target_store_registers (regcache, -1);
 
   do_cleanups (old_chain);
   return PS_OK;
This page took 0.024398 seconds and 4 git commands to generate.