]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* gregset.h (struct regcache): Add forward declaration.
authorUlrich Weigand <uweigand@de.ibm.com>
Sun, 6 May 2007 14:32:31 +0000 (14:32 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Sun, 6 May 2007 14:32:31 +0000 (14:32 +0000)
(supply_gregset): Add REGCACHE parameter, make GREGS const.
(supply_fpregset): Add REGCACHE parameter, make FPREGS const.
(supply_fpxregset): Add REGCACHE parameter, make FPXREGS const.
(fill_gregset): Add REGCACHE parameter.
(fill_fpregset): Likewise.
(fill_fpxregset): Likewise.

Update all definitions accordingly:
* alphabsd-nat.c, alpha-linux-nat.c, alpha-nat.c, amd64-linux-nat.c,
arm-linux-nat.c, hppa-linux-nat.c, i386gnu-nat.c, i386-linux-nat.c,
i386-sol2-nat.c, i386v4-nat.c, ia64-linux-nat.c, irix5-nat.c,
m32r-linux-nat.c, m68klinux-nat.c, mips-linux-nat.c, ppc-linux-nat.c,
s390-nat.c, sparc64-linux-nat.c, sparc-linux-nat.c, sparc-sol2-nat.c
(supply_gregset): Add REGCACHE parameter, use it instead of
current_regcache.  Make GREGSETP parameter const, adapt casts.
(supply_fpregset): Add REGCACHE parameter, use it instead of
current_regcache.  Make FPREGSETP parameter const, adapt casts.
(fill_gregset): Add REGCACHE parameter, use it instead of
current_regcache.
(fill_fpregset): Likewise.

Update all callers to pass in current_regcache as the new argument:
* core-regset.c: Include "regcache.h".
(fetch_core_registers): Update supply_gregset,and supply_fpregset calls.
* procfs.c: Include "regcache.h".
(procfs_fetch_registers): Update supply_gregset, supply_fpregset calls.
(procfs_store_registers): Update fill_gregset, fill_fpregset calls.
(procfs_do_thread_registers): Likewise.
(procfs_make_note_section): Likewise.
* proc-service.c: Include "regcache.h".
(ps_lgetregs): Update fill_gregset call.
(ps_lsetregs): Update supply_gregset call.
(ps_lgetfpregs): Update fill_fpregset call.
(ps_lsetfpregs): Update supply_fpregset call.
* sol-thread.c (sol_thread_fetch_registers): Update supply_gregset,
supply_fpregset calls.
(sol_thread_store_registers): Update fill_gregset, fill_fpregset calls.
(ps_lgetregs): Update fill_gregset call.
(ps_lsetregs): Update supply_gregset call.
(ps_lgetfpregs): Update fill_fpregset call.
(ps_lsetfpregs): Update supply_fpregset call.

* linux-nat.c (linux_nat_do_thread_registers): Update fill_gregset,
fill_fpregset, and fill_fpxregset calls.
* i386-linux-nat.c (fetch_regs): Update supply_gregset call.
(store_regs): Update fill_gregset call.
(fetch_fpregs): Update supply_fpregset call.
(store_fpregs): Update fill_fpregset call.
(fetch_fpxregs): Update supply_fpxregset call.
(store_fpxregs): Update fill_fpxregset call.
* m32r-linux-nat.c (fetch_regs): Update supply_gregset call.
(store_regs): Update fill_gregset call.
* m68klinux-nat.c (fetch_regs): Update supply_gregset call.
(store_regs): Update fill_gregset call.
(fetch_fpregs): Update supply_fpregset call.
(store_fpregs): Update fill_fpregset call.
(fetch_core_registers): Update supply_gregset, supply_fpregset calls.
* s390-nat.c (fetch_regs): Update supply_gregset call.
(store_regs): Update fill_gregset call.
(fetch_fpregs): Update supply_fpregset call.
(store_fpregs): Update fill_fpregset call.

* Makefile.in (core-regset.o, procfs.o, proc-service.o): Update
dependencies.

28 files changed:
gdb/ChangeLog
gdb/Makefile.in
gdb/alpha-linux-nat.c
gdb/alpha-nat.c
gdb/alphabsd-nat.c
gdb/amd64-linux-nat.c
gdb/arm-linux-nat.c
gdb/core-regset.c
gdb/gregset.h
gdb/hppa-linux-nat.c
gdb/i386-linux-nat.c
gdb/i386-sol2-nat.c
gdb/i386gnu-nat.c
gdb/i386v4-nat.c
gdb/ia64-linux-nat.c
gdb/irix5-nat.c
gdb/linux-nat.c
gdb/m32r-linux-nat.c
gdb/m68klinux-nat.c
gdb/mips-linux-nat.c
gdb/ppc-linux-nat.c
gdb/proc-service.c
gdb/procfs.c
gdb/s390-nat.c
gdb/sol-thread.c
gdb/sparc-linux-nat.c
gdb/sparc-sol2-nat.c
gdb/sparc64-linux-nat.c

index dd1fd7f9ebfc7b91a7e8840b860be6b240f4f05c..c7b921b926e356979f0fded8845d21f94f51462d 100644 (file)
@@ -1,3 +1,71 @@
+2007-05-06  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * gregset.h (struct regcache): Add forward declaration.
+       (supply_gregset): Add REGCACHE parameter, make GREGS const.
+       (supply_fpregset): Add REGCACHE parameter, make FPREGS const.
+       (supply_fpxregset): Add REGCACHE parameter, make FPXREGS const.
+       (fill_gregset): Add REGCACHE parameter.
+       (fill_fpregset): Likewise.
+       (fill_fpxregset): Likewise.
+
+       Update all definitions accordingly:
+       * alphabsd-nat.c, alpha-linux-nat.c, alpha-nat.c, amd64-linux-nat.c,
+       arm-linux-nat.c, hppa-linux-nat.c, i386gnu-nat.c, i386-linux-nat.c,
+       i386-sol2-nat.c, i386v4-nat.c, ia64-linux-nat.c, irix5-nat.c, 
+       m32r-linux-nat.c, m68klinux-nat.c, mips-linux-nat.c, ppc-linux-nat.c,
+       s390-nat.c, sparc64-linux-nat.c, sparc-linux-nat.c, sparc-sol2-nat.c 
+       (supply_gregset): Add REGCACHE parameter, use it instead of 
+       current_regcache.  Make GREGSETP parameter const, adapt casts.
+       (supply_fpregset): Add REGCACHE parameter, use it instead of
+       current_regcache.  Make FPREGSETP parameter const, adapt casts.
+       (fill_gregset): Add REGCACHE parameter, use it instead of
+       current_regcache.
+       (fill_fpregset): Likewise.
+
+       Update all callers to pass in current_regcache as the new argument:
+       * core-regset.c: Include "regcache.h".
+       (fetch_core_registers): Update supply_gregset,and supply_fpregset calls.
+       * procfs.c: Include "regcache.h".
+       (procfs_fetch_registers): Update supply_gregset, supply_fpregset calls.
+       (procfs_store_registers): Update fill_gregset, fill_fpregset calls.
+       (procfs_do_thread_registers): Likewise.
+       (procfs_make_note_section): Likewise.
+       * proc-service.c: Include "regcache.h".
+       (ps_lgetregs): Update fill_gregset call.
+       (ps_lsetregs): Update supply_gregset call.
+       (ps_lgetfpregs): Update fill_fpregset call.
+       (ps_lsetfpregs): Update supply_fpregset call.
+       * sol-thread.c (sol_thread_fetch_registers): Update supply_gregset,
+       supply_fpregset calls.
+       (sol_thread_store_registers): Update fill_gregset, fill_fpregset calls.
+       (ps_lgetregs): Update fill_gregset call.
+       (ps_lsetregs): Update supply_gregset call.
+       (ps_lgetfpregs): Update fill_fpregset call.
+       (ps_lsetfpregs): Update supply_fpregset call.
+       
+       * linux-nat.c (linux_nat_do_thread_registers): Update fill_gregset,
+       fill_fpregset, and fill_fpxregset calls.
+       * i386-linux-nat.c (fetch_regs): Update supply_gregset call.
+       (store_regs): Update fill_gregset call.
+       (fetch_fpregs): Update supply_fpregset call.
+       (store_fpregs): Update fill_fpregset call.
+       (fetch_fpxregs): Update supply_fpxregset call.
+       (store_fpxregs): Update fill_fpxregset call.
+       * m32r-linux-nat.c (fetch_regs): Update supply_gregset call.
+       (store_regs): Update fill_gregset call.
+       * m68klinux-nat.c (fetch_regs): Update supply_gregset call.
+       (store_regs): Update fill_gregset call.
+       (fetch_fpregs): Update supply_fpregset call.
+       (store_fpregs): Update fill_fpregset call.
+       (fetch_core_registers): Update supply_gregset, supply_fpregset calls.
+       * s390-nat.c (fetch_regs): Update supply_gregset call.
+       (store_regs): Update fill_gregset call.
+       (fetch_fpregs): Update supply_fpregset call.
+       (store_fpregs): Update fill_fpregset call.
+
+       * Makefile.in (core-regset.o, procfs.o, proc-service.o): Update
+       dependencies.
+
 2007-05-06  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * monitor.c (monitor_supply_register): Add REGCACHE parameter, use
index a24eea4220e840fac08a9bbbe83c87d5400201db..98a42747b988da9fe527f6863e748a58da72443c 100644 (file)
@@ -1887,7 +1887,7 @@ corelow.o: corelow.c $(defs_h) $(arch_utils_h) $(gdb_string_h) $(frame_h) \
        $(exec_h) $(readline_h) $(gdb_assert_h) \
        $(exceptions_h) $(solib_h)
 core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \
-       $(inferior_h) $(target_h) $(gdb_string_h) $(gregset_h)
+       $(inferior_h) $(target_h) $(regcache_h) $(gdb_string_h) $(gregset_h)
 cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \
        $(ui_out_h) $(gdb_string_h)
 cp-name-parser.o: cp-name-parser.c $(safe_ctype_h) $(libiberty_h) $(demangle_h)
@@ -2462,11 +2462,11 @@ proc-api.o: proc-api.c $(defs_h) $(gdbcmd_h) $(completer_h) $(gdb_wait_h) \
 proc-events.o: proc-events.c $(defs_h)
 proc-flags.o: proc-flags.c $(defs_h)
 procfs.o: procfs.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
-       $(elf_bfd_h) $(gdbcmd_h) $(gdbthread_h) $(gdb_wait_h) \
+       $(elf_bfd_h) $(gdbcmd_h) $(gdbthread_h) $(regcache_h) $(gdb_wait_h) \
        $(gdb_string_h) $(gdb_assert_h) $(inflow_h) $(auxv_h) \
        $(gdb_dirent_h) $(gdb_stat_h) $(proc_utils_h) $(gregset_h)
 proc-service.o: proc-service.c $(defs_h) $(gdb_proc_service_h) $(inferior_h) \
-       $(symtab_h) $(target_h) $(gregset_h)
+       $(symtab_h) $(target_h) $(regcache_h) $(gregset_h)
 proc-why.o: proc-why.c $(defs_h) $(proc_utils_h)
 prologue-value.o: prologue-value.c $(defs_h) $(gdb_string_h) $(gdb_assert_h) \
        $(prologue_value_h) $(regcache_h)
index 3b020ba151f611541fa8b8fffc6dc3be4c7cb553..016884a3275e5fea1cbbe9bcb501c08c54173842 100644 (file)
  */
 
 void
-supply_gregset (gdb_gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
 {
-  long *regp = (long *)gregsetp;
+  const long *regp = (const long *)gregsetp;
 
   /* PC is in slot 32, UNIQUE is in slot 33.  */
-  alpha_supply_int_regs (current_regcache, -1, regp, regp + 31, regp + 32);
+  alpha_supply_int_regs (regcache, -1, regp, regp + 31, regp + 32);
 }
 
 void
-fill_gregset (gdb_gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache,
+             gdb_gregset_t *gregsetp, int regno)
 {
   long *regp = (long *)gregsetp;
 
   /* PC is in slot 32, UNIQUE is in slot 33.  */
-  alpha_fill_int_regs (current_regcache, regno, regp, regp + 31, regp + 32);
+  alpha_fill_int_regs (regcache, regno, regp, regp + 31, regp + 32);
 }
 
 /*
@@ -63,21 +64,22 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
  */
 
 void
-supply_fpregset (gdb_fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
 {
-  long *regp = (long *)fpregsetp;
+  const long *regp = (const long *)fpregsetp;
 
   /* FPCR is in slot 32.  */
-  alpha_supply_fp_regs (current_regcache, -1, regp, regp + 31);
+  alpha_supply_fp_regs (regcache, -1, regp, regp + 31);
 }
 
 void
-fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              gdb_fpregset_t *fpregsetp, int regno)
 {
   long *regp = (long *)fpregsetp;
 
   /* FPCR is in slot 32.  */
-  alpha_fill_fp_regs (current_regcache, regno, regp, regp + 31);
+  alpha_fill_fp_regs (regcache, regno, regp, regp + 31);
 }
 
 
index 9a41dd182a713231ea6f29af70f4a503710f6a1f..bea5bcd1648a7c6e6d7e88ce7eab9f60741ffcc6 100644 (file)
@@ -153,21 +153,22 @@ kernel_u_size (void)
  */
 
 void
-supply_gregset (gdb_gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
 {
-  long *regp = gregsetp->regs;
+  const long *regp = gregsetp->regs;
 
   /* PC is in slot 32.  */
-  alpha_supply_int_regs (current_regcache, -1, regp, regp + 31, NULL);
+  alpha_supply_int_regs (regcache, -1, regp, regp + 31, NULL);
 }
 
 void
-fill_gregset (gdb_gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache,
+             gdb_gregset_t *gregsetp, int regno)
 {
   long *regp = gregsetp->regs;
 
   /* PC is in slot 32.  */
-  alpha_fill_int_regs (current_regcache, regno, regp, regp + 31, NULL);
+  alpha_fill_int_regs (regcache, regno, regp, regp + 31, NULL);
 }
 
 /*
@@ -176,21 +177,22 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
  */
 
 void
-supply_fpregset (gdb_fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
 {
-  long *regp = fpregsetp->regs;
+  const long *regp = fpregsetp->regs;
 
   /* FPCR is in slot 32.  */
-  alpha_supply_fp_regs (current_regcache, -1, regp, regp + 31);
+  alpha_supply_fp_regs (regcache, -1, regp, regp + 31);
 }
 
 void
-fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              gdb_fpregset_t *fpregsetp, int regno)
 {
   long *regp = fpregsetp->regs;
 
   /* FPCR is in slot 32.  */
-  alpha_fill_fp_regs (current_regcache, regno, regp, regp + 31);
+  alpha_fill_fp_regs (regcache, regno, regp, regp + 31);
 }
 #endif
 \f
index a8bf532e9f7ba180f01ec385fc252ad6e626d077..9eb1937cf9168a0fbd28f887c6b9acd745dd8e82 100644 (file)
@@ -50,27 +50,27 @@ typedef struct fpreg fpregset_t;
    supply/fill routines.  */
 
 void
-supply_gregset (gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
 {
-  alphabsd_supply_reg (current_regcache, (char *) gregsetp, -1);
+  alphabsd_supply_reg (regcache, (const char *) gregsetp, -1);
 }
 
 void
-fill_gregset (gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
 {
-  alphabsd_fill_reg (current_regcache, (char *) gregsetp, regno);
+  alphabsd_fill_reg (regcache, (char *) gregsetp, regno);
 }
 
 void
-supply_fpregset (fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
 {
-  alphabsd_supply_fpreg (current_regcache, (char *) fpregsetp, -1);
+  alphabsd_supply_fpreg (regcache, (const char *) fpregsetp, -1);
 }
 
 void
-fill_fpregset (fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache, fpregset_t *fpregsetp, int regno)
 {
-  alphabsd_fill_fpreg (current_regcache, (char *) fpregsetp, regno);
+  alphabsd_fill_fpreg (regcache, (char *) fpregsetp, regno);
 }
 \f
 /* Determine if PT_GETREGS fetches this register.  */
index 6f0e4a5fcbd2e38d97b055d55040e653a02f8d28..7a253a3c943ec842ebd297ec1e8a2c3c334c7413 100644 (file)
@@ -111,9 +111,9 @@ static int amd64_linux_gregset32_reg_offset[] =
    in *GREGSETP.  */
 
 void
-supply_gregset (elf_gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
 {
-  amd64_supply_native_gregset (current_regcache, gregsetp, -1);
+  amd64_supply_native_gregset (regcache, gregsetp, -1);
 }
 
 /* Fill register REGNUM (if it is a general-purpose register) in
@@ -121,9 +121,10 @@ supply_gregset (elf_gregset_t *gregsetp)
    do this for all registers.  */
 
 void
-fill_gregset (elf_gregset_t *gregsetp, int regnum)
+fill_gregset (const struct regcache *regcache,
+             elf_gregset_t *gregsetp, int regnum)
 {
-  amd64_collect_native_gregset (current_regcache, gregsetp, regnum);
+  amd64_collect_native_gregset (regcache, gregsetp, regnum);
 }
 
 /* Transfering floating-point registers between GDB, inferiors and cores.  */
@@ -132,9 +133,9 @@ fill_gregset (elf_gregset_t *gregsetp, int regnum)
    values in *FPREGSETP.  */
 
 void
-supply_fpregset (elf_fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp)
 {
-  amd64_supply_fxsave (current_regcache, -1, fpregsetp);
+  amd64_supply_fxsave (regcache, -1, fpregsetp);
 }
 
 /* Fill register REGNUM (if it is a floating-point or SSE register) in
@@ -142,9 +143,10 @@ supply_fpregset (elf_fpregset_t *fpregsetp)
    -1, do this for all registers.  */
 
 void
-fill_fpregset (elf_fpregset_t *fpregsetp, int regnum)
+fill_fpregset (const struct regcache *regcache,
+              elf_fpregset_t *fpregsetp, int regnum)
 {
-  amd64_collect_fxsave (current_regcache, regnum, fpregsetp);
+  amd64_collect_fxsave (regcache, regnum, fpregsetp);
 }
 \f
 
index b50f8969a184331bcb0a7961364bf677875ee4b1..997120dbc4322c7192c4f29a57e6d0491a3eea9f 100644 (file)
@@ -503,30 +503,32 @@ arm_linux_store_inferior_registers (int regno)
    thread debugging.  */
 
 void
-fill_gregset (gdb_gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache, 
+             gdb_gregset_t *gregsetp, int regno)
 {
-  arm_linux_collect_gregset (NULL, current_regcache, regno, gregsetp, 0);
+  arm_linux_collect_gregset (NULL, regcache, regno, gregsetp, 0);
 }
 
 void
-supply_gregset (gdb_gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
 {
-  arm_linux_supply_gregset (NULL, current_regcache, -1, gregsetp, 0);
+  arm_linux_supply_gregset (NULL, regcache, -1, gregsetp, 0);
 }
 
 void
-fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              gdb_fpregset_t *fpregsetp, int regno)
 {
-  arm_linux_collect_nwfpe (NULL, current_regcache, regno, fpregsetp, 0);
+  arm_linux_collect_nwfpe (NULL, regcache, regno, fpregsetp, 0);
 }
 
 /* Fill GDB's register array with the floating-point register values
    in *fpregsetp.  */
 
 void
-supply_fpregset (gdb_fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
 {
-  arm_linux_supply_nwfpe (NULL, current_regcache, -1, fpregsetp, 0);
+  arm_linux_supply_nwfpe (NULL, regcache, -1, fpregsetp, 0);
 }
 
 /* Fetch the thread-local storage pointer for libthread_db.  */
index 3f104860722373e3f56c2486b143d47dba1780af..a43922d6426bf197d399b23a914164f3fb114766 100644 (file)
@@ -34,6 +34,7 @@
 #include "gdbcore.h"
 #include "inferior.h"
 #include "target.h"
+#include "regcache.h"
 
 #include <fcntl.h>
 #include <errno.h>
@@ -73,7 +74,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
       else
        {
          memcpy (&gregset, core_reg_sect, sizeof (gregset));
-         supply_gregset (&gregset);
+         supply_gregset (current_regcache, (const gdb_gregset_t *) &gregset);
        }
       break;
 
@@ -84,7 +85,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
        {
          memcpy (&fpregset, core_reg_sect, sizeof (fpregset));
          if (FP0_REGNUM >= 0)
-           supply_fpregset (&fpregset);
+           supply_fpregset (current_regcache, (const gdb_fpregset_t *) &fpregset);
        }
       break;
 
index ae17542aac2611ab1fcb8f5b0fdf3417c0a55c4a..38caacea59449699e83fc94a2a3c70b27ed22105 100644 (file)
@@ -32,6 +32,8 @@
 typedef GDB_GREGSET_T gdb_gregset_t;
 typedef GDB_FPREGSET_T gdb_fpregset_t;
 
+struct regcache;
+
 /* A gregset is a data structure supplied by the native OS containing
    the general register values of the debugged process.  Usually this
    includes integer registers and control registers.  An fpregset is a
@@ -42,15 +44,19 @@ typedef GDB_FPREGSET_T gdb_fpregset_t;
 /* Copy register values from the native target gregset/fpregset
    into GDB's internal register cache.  */
 
-extern void supply_gregset (gdb_gregset_t *gregs);
-extern void supply_fpregset (gdb_fpregset_t *fpregs);
+extern void supply_gregset (struct regcache *regcache,
+                           const gdb_gregset_t *gregs);
+extern void supply_fpregset (struct regcache *regcache,
+                            const gdb_fpregset_t *fpregs);
 
 /* Copy register values from GDB's register cache into
    the native target gregset/fpregset.  If regno is -1, 
    copy all the registers.  */
 
-extern void fill_gregset (gdb_gregset_t *gregs, int regno);
-extern void fill_fpregset (gdb_fpregset_t *fpregs, int regno);
+extern void fill_gregset (const struct regcache *regcache,
+                         gdb_gregset_t *gregs, int regno);
+extern void fill_fpregset (const struct regcache *regcache,
+                          gdb_fpregset_t *fpregs, int regno);
 
 #ifdef FILL_FPXREGSET
 /* GNU/Linux i386: Copy register values between GDB's internal register cache
@@ -62,8 +68,10 @@ extern void fill_fpregset (gdb_fpregset_t *fpregs, int regno);
 
 typedef GDB_FPXREGSET_T gdb_fpxregset_t;
 
-extern void supply_fpxregset (gdb_fpxregset_t *fpxregs);
-extern void fill_fpxregset (gdb_fpxregset_t *fpxregs, int regno);
+extern void supply_fpxregset (struct regcache *regcache,
+                             const gdb_fpxregset_t *fpxregs);
+extern void fill_fpxregset (const struct regcache *regcache,
+                           gdb_fpxregset_t *fpxregs, int regno);
 #endif
 
 #endif
index ec6f5456437071c2efb2e6bba270cc7c6a3c4ca3..274f14007bb53c7aee8e910c33ec09ca8718c1e1 100644 (file)
@@ -305,15 +305,15 @@ hppa_linux_store_inferior_registers (int regno)
    in *gregsetp.  */
 
 void
-supply_gregset (gdb_gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
 {
   int i;
-  greg_t *regp = (elf_greg_t *) gregsetp;
+  const greg_t *regp = (const elf_greg_t *) gregsetp;
 
   for (i = 0; i < sizeof (greg_map) / sizeof (greg_map[0]); i++, regp++)
     {
       int regno = greg_map[i];
-      regcache_raw_supply (current_regcache, regno, regp);
+      regcache_raw_supply (regcache, regno, regp);
     }
 }
 
@@ -322,7 +322,8 @@ supply_gregset (gdb_gregset_t *gregsetp)
    If regno is -1, do this for all registers.  */
 
 void
-fill_gregset (gdb_gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache,
+             gdb_gregset_t *gregsetp, int regno)
 {
   int i;
 
@@ -332,7 +333,7 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
 
       if (regno == -1 || regno == mregno)
        {
-          regcache_raw_collect(current_regcache, mregno, &(*gregsetp)[i]);
+          regcache_raw_collect(regcache, mregno, &(*gregsetp)[i]);
        }
     }
 }
@@ -342,17 +343,16 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
    idea of the current floating point register values. */
 
 void
-supply_fpregset (gdb_fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
 {
   int regi;
-  char *from;
+  const char *from;
 
   for (regi = 0; regi <= 31; regi++)
     {
-      from = (char *) &((*fpregsetp)[regi]);
-      regcache_raw_supply (current_regcache, 2*regi + HPPA_FP0_REGNUM, from);
-      regcache_raw_supply (current_regcache, 2*regi + HPPA_FP0_REGNUM + 1,
-                          from + 4);
+      from = (const char *) &((*fpregsetp)[regi]);
+      regcache_raw_supply (regcache, 2*regi + HPPA_FP0_REGNUM, from);
+      regcache_raw_supply (regcache, 2*regi + HPPA_FP0_REGNUM + 1, from + 4);
     }
 }
 
@@ -362,7 +362,8 @@ supply_fpregset (gdb_fpregset_t *fpregsetp)
    them all. */
 
 void
-fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              gdb_fpregset_t *fpregsetp, int regno)
 {
   int i;
 
@@ -373,7 +374,7 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
       char *to = (char *) &((*fpregsetp)[(i - HPPA_FP0_REGNUM) / 2]);
       if ((i - HPPA_FP0_REGNUM) & 1)
        to += 4;
-      regcache_raw_collect (current_regcache, i, to);
+      regcache_raw_collect (regcache, i, to);
    }
 }
 
index 8572c579a976a0b35e1b606247e01b58550b38ae..bfa099dd0118bed0a12d385ae69b0c543aac8449 100644 (file)
@@ -201,16 +201,16 @@ store_register (int regno)
    in *GREGSETP.  */
 
 void
-supply_gregset (elf_gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
 {
-  elf_greg_t *regp = (elf_greg_t *) gregsetp;
+  const elf_greg_t *regp = (const elf_greg_t *) gregsetp;
   int i;
 
   for (i = 0; i < I386_NUM_GREGS; i++)
-    regcache_raw_supply (current_regcache, i, regp + regmap[i]);
+    regcache_raw_supply (regcache, i, regp + regmap[i]);
 
   if (I386_LINUX_ORIG_EAX_REGNUM < NUM_REGS)
-    regcache_raw_supply (current_regcache, I386_LINUX_ORIG_EAX_REGNUM,
+    regcache_raw_supply (regcache, I386_LINUX_ORIG_EAX_REGNUM,
                         regp + ORIG_EAX);
 }
 
@@ -219,18 +219,19 @@ supply_gregset (elf_gregset_t *gregsetp)
    do this for all registers.  */
 
 void
-fill_gregset (elf_gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache,
+             elf_gregset_t *gregsetp, int regno)
 {
   elf_greg_t *regp = (elf_greg_t *) gregsetp;
   int i;
 
   for (i = 0; i < I386_NUM_GREGS; i++)
     if (regno == -1 || regno == i)
-      regcache_raw_collect (current_regcache, i, regp + regmap[i]);
+      regcache_raw_collect (regcache, i, regp + regmap[i]);
 
   if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
       && I386_LINUX_ORIG_EAX_REGNUM < NUM_REGS)
-    regcache_raw_collect (current_regcache, I386_LINUX_ORIG_EAX_REGNUM,
+    regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM,
                          regp + ORIG_EAX);
 }
 
@@ -257,7 +258,7 @@ fetch_regs (int tid)
       perror_with_name (_("Couldn't get registers"));
     }
 
-  supply_gregset (&regs);
+  supply_gregset (current_regcache, (const elf_gregset_t *) &regs);
 }
 
 /* Store all valid general-purpose registers in GDB's register array
@@ -271,7 +272,7 @@ store_regs (int tid, int regno)
   if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't get registers"));
 
-  fill_gregset (&regs, regno);
+  fill_gregset (current_regcache, &regs, regno);
   
   if (ptrace (PTRACE_SETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't write registers"));
@@ -291,9 +292,9 @@ static void store_regs (int tid, int regno) {}
    *FPREGSETP.  */
 
 void 
-supply_fpregset (elf_fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp)
 {
-  i387_supply_fsave (current_regcache, -1, fpregsetp);
+  i387_supply_fsave (regcache, -1, fpregsetp);
 }
 
 /* Fill register REGNO (if it is a floating-point register) in
@@ -301,9 +302,10 @@ supply_fpregset (elf_fpregset_t *fpregsetp)
    do this for all registers.  */
 
 void
-fill_fpregset (elf_fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              elf_fpregset_t *fpregsetp, int regno)
 {
-  i387_collect_fsave (current_regcache, regno, fpregsetp);
+  i387_collect_fsave (regcache, regno, fpregsetp);
 }
 
 #ifdef HAVE_PTRACE_GETREGS
@@ -319,7 +321,7 @@ fetch_fpregs (int tid)
   if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0)
     perror_with_name (_("Couldn't get floating point status"));
 
-  supply_fpregset (&fpregs);
+  supply_fpregset (current_regcache, (const elf_fpregset_t *) &fpregs);
 }
 
 /* Store all valid floating-point registers in GDB's register array
@@ -333,7 +335,7 @@ store_fpregs (int tid, int regno)
   if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0)
     perror_with_name (_("Couldn't get floating point status"));
 
-  fill_fpregset (&fpregs, regno);
+  fill_fpregset (current_regcache, &fpregs, regno);
 
   if (ptrace (PTRACE_SETFPREGS, tid, 0, (int) &fpregs) < 0)
     perror_with_name (_("Couldn't write floating point status"));
@@ -355,9 +357,10 @@ static void store_fpregs (int tid, int regno) {}
    values in *FPXREGSETP.  */
 
 void
-supply_fpxregset (elf_fpxregset_t *fpxregsetp)
+supply_fpxregset (struct regcache *regcache,
+                 const elf_fpxregset_t *fpxregsetp)
 {
-  i387_supply_fxsave (current_regcache, -1, fpxregsetp);
+  i387_supply_fxsave (regcache, -1, fpxregsetp);
 }
 
 /* Fill register REGNO (if it is a floating-point or SSE register) in
@@ -365,9 +368,10 @@ supply_fpxregset (elf_fpxregset_t *fpxregsetp)
    -1, do this for all registers.  */
 
 void
-fill_fpxregset (elf_fpxregset_t *fpxregsetp, int regno)
+fill_fpxregset (const struct regcache *regcache,
+               elf_fpxregset_t *fpxregsetp, int regno)
 {
-  i387_collect_fxsave (current_regcache, regno, fpxregsetp);
+  i387_collect_fxsave (regcache, regno, fpxregsetp);
 }
 
 /* Fetch all registers covered by the PTRACE_GETFPXREGS request from
@@ -393,7 +397,7 @@ fetch_fpxregs (int tid)
       perror_with_name (_("Couldn't read floating-point and SSE registers"));
     }
 
-  supply_fpxregset (&fpxregs);
+  supply_fpxregset (current_regcache, (const elf_fpxregset_t *) &fpxregs);
   return 1;
 }
 
@@ -420,7 +424,7 @@ store_fpxregs (int tid, int regno)
       perror_with_name (_("Couldn't read floating-point and SSE registers"));
     }
 
-  fill_fpxregset (&fpxregs, regno);
+  fill_fpxregset (current_regcache, &fpxregs, regno);
 
   if (ptrace (PTRACE_SETFPXREGS, tid, 0, &fpxregs) == -1)
     perror_with_name (_("Couldn't write floating-point and SSE registers"));
index 97362e0e07a12041ae68562f8e71a4cbacbae9ee..d47ca6181234c17e685e8f793321ccd88e0ffd70 100644 (file)
@@ -99,27 +99,29 @@ static int amd64_sol2_gregset32_reg_offset[] = {
 };
 
 void
-supply_gregset (prgregset_t *gregs)
+supply_gregset (struct regcache *regcache, const prgregset_t *gregs)
 {
-  amd64_supply_native_gregset (current_regcache, gregs, -1);
+  amd64_supply_native_gregset (regcache, gregs, -1);
 }
 
 void
-supply_fpregset (prfpregset_t *fpregs)
+supply_fpregset (struct regcache *regcache, const prfpregset_t *fpregs)
 {
-  amd64_supply_fxsave (current_regcache, -1, fpregs);
+  amd64_supply_fxsave (regcache, -1, fpregs);
 }
 
 void
-fill_gregset (prgregset_t *gregs, int regnum)
+fill_gregset (const struct regcache *regcache,
+             prgregset_t *gregs, int regnum)
 {
-  amd64_collect_native_gregset (current_regcache, gregs, regnum);
+  amd64_collect_native_gregset (regcache, gregs, regnum);
 }
 
 void
-fill_fpregset (prfpregset_t *fpregs, int regnum)
+fill_fpregset (const struct regcache *regcache,
+              prfpregset_t *fpregs, int regnum)
 {
-  amd64_collect_fxsave (current_regcache, regnum, fpregs);
+  amd64_collect_fxsave (regcache, regnum, fpregs);
 }
 
 #else
index 3c2c574f091a6e5a9f0d49516a20a16b8f089aaf..3b6199711f2272657a2c39f30451a44f60831e78 100644 (file)
@@ -59,6 +59,7 @@ static int reg_offset[] =
 };
 
 #define REG_ADDR(state, regnum) ((char *)(state) + reg_offset[regnum])
+#define CREG_ADDR(state, regnum) ((const char *)(state) + reg_offset[regnum])
 
 \f
 /* Get the whole floating-point state of THREAD and record the values
@@ -96,17 +97,17 @@ fetch_fpregs (struct proc *thread)
 /* These two calls are used by the core-regset.c code for
    reading ELF core files.  */
 void
-supply_gregset (gdb_gregset_t *gregs)
+supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregs)
 {
   int i;
   for (i = 0; i < I386_NUM_GREGS; i++)
-    regcache_raw_supply (current_regcache, i, REG_ADDR (gregs, i));
+    regcache_raw_supply (regcache, i, CREG_ADDR (gregs, i));
 }
 
 void
-supply_fpregset (gdb_fpregset_t *fpregs)
+supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregs)
 {
-  i387_supply_fsave (current_regcache, -1, fpregs);
+  i387_supply_fsave (regcache, -1, fpregs);
 }
 #endif
 
index 6829fa6d2fae48fb18d560517bd1926f521141be..695207b3847c2145d180f934dd4cc3fc826d3511 100644 (file)
@@ -104,13 +104,13 @@ static int regmap[] =
    in *GREGSETP.  */
 
 void
-supply_gregset (gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
 {
-  greg_t *regp = (greg_t *) gregsetp;
+  const greg_t *regp = (const greg_t *) gregsetp;
   int regnum;
 
   for (regnum = 0; regnum < I386_NUM_GREGS; regnum++)
-    regcache_raw_supply (current_regcache, regnum, regp + regmap[regnum]);
+    regcache_raw_supply (regcache, regnum, regp + regmap[regnum]);
 }
 
 /* Fill register REGNUM (if it is a general-purpose register) in
@@ -118,14 +118,15 @@ supply_gregset (gregset_t *gregsetp)
    do this for all registers.  */
 
 void
-fill_gregset (gregset_t *gregsetp, int regnum)
+fill_gregset (const struct regcache *regcache,
+             gregset_t *gregsetp, int regnum)
 {
   greg_t *regp = (greg_t *) gregsetp;
   int i;
 
   for (i = 0; i < I386_NUM_GREGS; i++)
     if (regnum == -1 || regnum == i)
-      regcache_raw_collect (current_regcache, i, regp + regmap[i]);
+      regcache_raw_collect (regcache, i, regp + regmap[i]);
 }
 
 #endif /* HAVE_GREGSET_T */
@@ -136,12 +137,12 @@ fill_gregset (gregset_t *gregsetp, int regnum)
    *FPREGSETP.  */
 
 void
-supply_fpregset (fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
 {
   if (FP0_REGNUM == 0)
     return;
 
-  i387_supply_fsave (current_regcache, -1, fpregsetp);
+  i387_supply_fsave (regcache, -1, fpregsetp);
 }
 
 /* Fill register REGNO (if it is a floating-point register) in
@@ -149,12 +150,13 @@ supply_fpregset (fpregset_t *fpregsetp)
    do this for all registers.  */
 
 void
-fill_fpregset (fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              fpregset_t *fpregsetp, int regno)
 {
   if (FP0_REGNUM == 0)
     return;
 
-  i387_collect_fsave (current_regcache, regno, fpregsetp);
+  i387_collect_fsave (regcache, regno, fpregsetp);
 }
 
 #endif /* HAVE_FPREGSET_T */
index 989550a81203c8b8f5100aefaa4d17c44156bc89..8207be41cdecc7b6583ac0495b1641ca3c07758c 100644 (file)
@@ -362,65 +362,51 @@ ia64_cannot_store_register (int regno)
 }
 
 void
-supply_gregset (gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
 {
   int regi;
-  greg_t *regp = (greg_t *) gregsetp;
+  const greg_t *regp = (const greg_t *) gregsetp;
 
   for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
     {
-      regcache_raw_supply (current_regcache, regi,
-                          (char *) (regp + (regi - IA64_GR0_REGNUM)));
+      regcache_raw_supply (regcache, regi, regp + (regi - IA64_GR0_REGNUM));
     }
 
   /* FIXME: NAT collection bits are at index 32; gotta deal with these
      somehow... */
 
-  regcache_raw_supply (current_regcache, IA64_PR_REGNUM, (char *) (regp + 33));
+  regcache_raw_supply (regcache, IA64_PR_REGNUM, regp + 33);
 
   for (regi = IA64_BR0_REGNUM; regi <= IA64_BR7_REGNUM; regi++)
     {
-      regcache_raw_supply (current_regcache, regi,
-                          (char *) (regp + 34 + (regi - IA64_BR0_REGNUM)));
+      regcache_raw_supply (regcache, regi,
+                          regp + 34 + (regi - IA64_BR0_REGNUM));
     }
 
-  regcache_raw_supply (current_regcache, IA64_IP_REGNUM,
-                      (char *) (regp + 42));
-  regcache_raw_supply (current_regcache, IA64_CFM_REGNUM,
-                      (char *) (regp + 43));
-  regcache_raw_supply (current_regcache, IA64_PSR_REGNUM,
-                      (char *) (regp + 44));
-  regcache_raw_supply (current_regcache, IA64_RSC_REGNUM,
-                      (char *) (regp + 45));
-  regcache_raw_supply (current_regcache, IA64_BSP_REGNUM,
-                      (char *) (regp + 46));
-  regcache_raw_supply (current_regcache, IA64_BSPSTORE_REGNUM,
-                      (char *) (regp + 47));
-  regcache_raw_supply (current_regcache, IA64_RNAT_REGNUM,
-                      (char *) (regp + 48));
-  regcache_raw_supply (current_regcache, IA64_CCV_REGNUM,
-                      (char *) (regp + 49));
-  regcache_raw_supply (current_regcache, IA64_UNAT_REGNUM,
-                      (char *) (regp + 50));
-  regcache_raw_supply (current_regcache, IA64_FPSR_REGNUM,
-                      (char *) (regp + 51));
-  regcache_raw_supply (current_regcache, IA64_PFS_REGNUM,
-                      (char *) (regp + 52));
-  regcache_raw_supply (current_regcache, IA64_LC_REGNUM,
-                      (char *) (regp + 53));
-  regcache_raw_supply (current_regcache, IA64_EC_REGNUM,
-                      (char *) (regp + 54));
+  regcache_raw_supply (regcache, IA64_IP_REGNUM, regp + 42);
+  regcache_raw_supply (regcache, IA64_CFM_REGNUM, regp + 43);
+  regcache_raw_supply (regcache, IA64_PSR_REGNUM, regp + 44);
+  regcache_raw_supply (regcache, IA64_RSC_REGNUM, regp + 45);
+  regcache_raw_supply (regcache, IA64_BSP_REGNUM, regp + 46);
+  regcache_raw_supply (regcache, IA64_BSPSTORE_REGNUM, regp + 47);
+  regcache_raw_supply (regcache, IA64_RNAT_REGNUM, regp + 48);
+  regcache_raw_supply (regcache, IA64_CCV_REGNUM, regp + 49);
+  regcache_raw_supply (regcache, IA64_UNAT_REGNUM, regp + 50);
+  regcache_raw_supply (regcache, IA64_FPSR_REGNUM, regp + 51);
+  regcache_raw_supply (regcache, IA64_PFS_REGNUM, regp + 52);
+  regcache_raw_supply (regcache, IA64_LC_REGNUM, regp + 53);
+  regcache_raw_supply (regcache, IA64_EC_REGNUM, regp + 54);
 }
 
 void
-fill_gregset (gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
 {
   int regi;
   greg_t *regp = (greg_t *) gregsetp;
 
 #define COPY_REG(_idx_,_regi_) \
   if ((regno == -1) || regno == _regi_) \
-    regcache_raw_collect (current_regcache, _regi_, regp + _idx_)
+    regcache_raw_collect (regcache, _regi_, regp + _idx_)
 
   for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
     {
@@ -456,15 +442,15 @@ fill_gregset (gregset_t *gregsetp, int regno)
    idea of the current floating point register values. */
 
 void
-supply_fpregset (fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
 {
   int regi;
-  char *from;
+  const char *from;
 
   for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
     {
-      from = (char *) &((*fpregsetp)[regi - IA64_FR0_REGNUM]);
-      regcache_raw_supply (current_regcache, regi, from);
+      from = (const char *) &((*fpregsetp)[regi - IA64_FR0_REGNUM]);
+      regcache_raw_supply (regcache, regi, from);
     }
 }
 
@@ -474,14 +460,15 @@ supply_fpregset (fpregset_t *fpregsetp)
    them all. */
 
 void
-fill_fpregset (fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              fpregset_t *fpregsetp, int regno)
 {
   int regi;
 
   for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
     {
       if ((regno == -1) || (regno == regi))
-       regcache_raw_collect (current_regcache, regi,
+       regcache_raw_collect (regcache, regi,
                              &((*fpregsetp)[regi - IA64_FR0_REGNUM]));
     }
 }
index 184d8cecaf4d5e64345b177e39d23f1567c1af8e..907764c085df9848088857052f774493f95b28cc 100644 (file)
@@ -54,32 +54,32 @@ static void fetch_core_registers (char *, unsigned int, int, CORE_ADDR);
  */
 
 void
-supply_gregset (gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
 {
   int regi;
-  greg_t *regp = &(*gregsetp)[0];
+  const greg_t *regp = &(*gregsetp)[0];
   int gregoff = sizeof (greg_t) - mips_isa_regsize (current_gdbarch);
   static char zerobuf[32] = {0};
 
   for (regi = 0; regi <= CTX_RA; regi++)
-    regcache_raw_supply (current_regcache, regi,
-                        (char *) (regp + regi) + gregoff);
-
-  regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->pc,
-                      (char *) (regp + CTX_EPC) + gregoff);
-  regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->hi,
-                      (char *) (regp + CTX_MDHI) + gregoff);
-  regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->lo,
-                      (char *) (regp + CTX_MDLO) + gregoff);
-  regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->cause,
-                      (char *) (regp + CTX_CAUSE) + gregoff);
+    regcache_raw_supply (regcache, regi,
+                        (const char *) (regp + regi) + gregoff);
+
+  regcache_raw_supply (regcache, mips_regnum (current_gdbarch)->pc,
+                      (const char *) (regp + CTX_EPC) + gregoff);
+  regcache_raw_supply (regcache, mips_regnum (current_gdbarch)->hi,
+                      (const char *) (regp + CTX_MDHI) + gregoff);
+  regcache_raw_supply (regcache, mips_regnum (current_gdbarch)->lo,
+                      (const char *) (regp + CTX_MDLO) + gregoff);
+  regcache_raw_supply (regcache, mips_regnum (current_gdbarch)->cause,
+                      (const char *) (regp + CTX_CAUSE) + gregoff);
 
   /* Fill inaccessible registers with zero.  */
-  regcache_raw_supply (current_regcache, mips_regnum (current_gdbarch)->badvaddr, zerobuf);
+  regcache_raw_supply (regcache, mips_regnum (current_gdbarch)->badvaddr, zerobuf);
 }
 
 void
-fill_gregset (gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
 {
   int regi, size;
   greg_t *regp = &(*gregsetp)[0];
@@ -93,7 +93,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
     if ((regno == -1) || (regno == regi))
       {
        size = register_size (current_gdbarch, regi);
-       regcache_raw_collect (current_regcache, regi, buf);
+       regcache_raw_collect (regcache, regi, buf);
        *(regp + regi) = extract_signed_integer (buf, size);
       }
 
@@ -101,7 +101,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
     {
       regi = mips_regnum (current_gdbarch)->pc;
       size = register_size (current_gdbarch, regi);
-      regcache_raw_collect (current_regcache, regi, buf);
+      regcache_raw_collect (regcache, regi, buf);
       *(regp + CTX_EPC) = extract_signed_integer (buf, size);
     }
 
@@ -109,7 +109,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
     {
       regi = mips_regnum (current_gdbarch)->cause;
       size = register_size (current_gdbarch, regi);
-      regcache_raw_collect (current_regcache, regi, buf);
+      regcache_raw_collect (regcache, regi, buf);
       *(regp + CTX_CAUSE) = extract_signed_integer (buf, size);
     }
 
@@ -117,7 +117,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
     {
       regi = mips_regnum (current_gdbarch)->hi;
       size = register_size (current_gdbarch, regi);
-      regcache_raw_collect (current_regcache, regi, buf);
+      regcache_raw_collect (regcache, regi, buf);
       *(regp + CTX_MDHI) = extract_signed_integer (buf, size);
     }
 
@@ -125,7 +125,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
     {
       regi = mips_regnum (current_gdbarch)->lo;
       size = register_size (current_gdbarch, regi);
-      regcache_raw_collect (current_regcache, regi, buf);
+      regcache_raw_collect (regcache, regi, buf);
       *(regp + CTX_MDLO) = extract_signed_integer (buf, size);
     }
 }
@@ -139,7 +139,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
  */
 
 void
-supply_fpregset (fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
 {
   int regi;
   static char zerobuf[32] = {0};
@@ -148,8 +148,8 @@ supply_fpregset (fpregset_t *fpregsetp)
   /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
 
   for (regi = 0; regi < 32; regi++)
-    regcache_raw_supply (current_regcache, FP0_REGNUM + regi,
-                        (char *) &fpregsetp->fp_r.fp_regs[regi]);
+    regcache_raw_supply (regcache, FP0_REGNUM + regi,
+                        (const char *) &fpregsetp->fp_r.fp_regs[regi]);
 
   /* We can't supply the FSR register directly to the regcache,
      because there is a size issue: On one hand, fpregsetp->fp_csr
@@ -159,18 +159,18 @@ supply_fpregset (fpregset_t *fpregsetp)
   memset (fsrbuf, 0, 4);
   memcpy (fsrbuf + 4, &fpregsetp->fp_csr, 4);
 
-  regcache_raw_supply (current_regcache,
+  regcache_raw_supply (regcache,
                       mips_regnum (current_gdbarch)->fp_control_status,
                       fsrbuf);
 
   /* FIXME: how can we supply FCRIR?  SGI doesn't tell us. */
-  regcache_raw_supply (current_regcache,
+  regcache_raw_supply (regcache,
                       mips_regnum (current_gdbarch)->fp_implementation_revision,
                       zerobuf);
 }
 
 void
-fill_fpregset (fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache, fpregset_t *fpregsetp, int regno)
 {
   int regi;
   char *from, *to;
@@ -182,7 +182,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
       if ((regno == -1) || (regno == regi))
        {
          to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
-          regcache_raw_collect (current_regcache, regi, to);
+          regcache_raw_collect (regcache, regi, to);
        }
     }
 
@@ -196,7 +196,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
          is 32bits long, while the regcache expects a 64bits long buffer.
          So we use a buffer of the correct size and copy the register
          value from that buffer.  */
-      regcache_raw_collect (current_regcache,
+      regcache_raw_collect (regcache,
                            mips_regnum (current_gdbarch)->fp_control_status,
                            fsrbuf);
 
index 8430eb73078928112dab17d3adfb9e2dabffb64a..46655815d272e66c3c27226822f8409127cc3324 100644 (file)
@@ -2591,7 +2591,7 @@ linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
     regset->collect_regset (regset, current_regcache, -1,
                            &gregs, sizeof (gregs));
   else
-    fill_gregset (&gregs, -1);
+    fill_gregset (current_regcache, &gregs, -1);
 
   note_data = (char *) elfcore_write_prstatus (obfd,
                                               note_data,
@@ -2606,7 +2606,7 @@ linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
     regset->collect_regset (regset, current_regcache, -1,
                            &fpregs, sizeof (fpregs));
   else
-    fill_fpregset (&fpregs, -1);
+    fill_fpregset (current_regcache, &fpregs, -1);
 
   note_data = (char *) elfcore_write_prfpreg (obfd,
                                              note_data,
@@ -2621,7 +2621,7 @@ linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
     regset->collect_regset (regset, current_regcache, -1,
                            &fpxregs, sizeof (fpxregs));
   else
-    fill_fpxregset (&fpxregs, -1);
+    fill_fpxregset (current_regcache, &fpxregs, -1);
 
   note_data = (char *) elfcore_write_prxfpreg (obfd,
                                               note_data,
index 2b17aadf2fee0146f5969a0b873ee342c6ce3fc3..32d3de91403560f68621d75fbf7bfdc6358473ca 100644 (file)
@@ -69,9 +69,9 @@ static int regmap[] = {
    in *GREGSETP.  */
 
 void
-supply_gregset (elf_gregset_t * gregsetp)
+supply_gregset (struct regcache *regcache, const elf_gregset_t * gregsetp)
 {
-  elf_greg_t *regp = (elf_greg_t *) gregsetp;
+  const elf_greg_t *regp = (const elf_greg_t *) gregsetp;
   int i;
   unsigned long psw, bbpsw;
 
@@ -96,11 +96,11 @@ supply_gregset (elf_gregset_t * gregsetp)
        }
 
       if (i != M32R_SP_REGNUM)
-       regcache_raw_supply (current_regcache, i, &regval);
+       regcache_raw_supply (regcache, i, &regval);
       else if (psw & 0x8000)
-       regcache_raw_supply (current_regcache, i, regp + SPU_REGMAP);
+       regcache_raw_supply (regcache, i, regp + SPU_REGMAP);
       else
-       regcache_raw_supply (current_regcache, i, regp + SPI_REGMAP);
+       regcache_raw_supply (regcache, i, regp + SPI_REGMAP);
     }
 }
 
@@ -115,7 +115,7 @@ fetch_regs (int tid)
   if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't get registers"));
 
-  supply_gregset (&regs);
+  supply_gregset (current_regcache, (const elf_gregset_t *) &regs);
 }
 
 /* Fill register REGNO (if it is a general-purpose register) in
@@ -123,7 +123,8 @@ fetch_regs (int tid)
    do this for all registers.  */
 
 void
-fill_gregset (elf_gregset_t * gregsetp, int regno)
+fill_gregset (const struct regcache *regcache,
+             elf_gregset_t * gregsetp, int regno)
 {
   elf_greg_t *regp = (elf_greg_t *) gregsetp;
   int i;
@@ -144,11 +145,11 @@ fill_gregset (elf_gregset_t * gregsetp, int regno)
        continue;
 
       if (i != M32R_SP_REGNUM)
-       regcache_raw_collect (current_regcache, i, regp + regmap[i]);
+       regcache_raw_collect (regcache, i, regp + regmap[i]);
       else if (psw & 0x8000)
-       regcache_raw_collect (current_regcache, i, regp + SPU_REGMAP);
+       regcache_raw_collect (regcache, i, regp + SPU_REGMAP);
       else
-       regcache_raw_collect (current_regcache, i, regp + SPI_REGMAP);
+       regcache_raw_collect (regcache, i, regp + SPI_REGMAP);
     }
 }
 
@@ -163,7 +164,7 @@ store_regs (int tid, int regno)
   if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't get registers"));
 
-  fill_gregset (&regs, regno);
+  fill_gregset (current_regcache, &regs, regno);
 
   if (ptrace (PTRACE_SETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't write registers"));
@@ -175,12 +176,13 @@ store_regs (int tid, int regno)
    Since M32R has no floating-point registers, these functions do nothing.  */
 
 void
-supply_fpregset (gdb_fpregset_t *fpregs)
+supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregs)
 {
 }
 
 void
-fill_fpregset (gdb_fpregset_t *fpregs, int regno)
+fill_fpregset (const struct regcache *regcache,
+              gdb_fpregset_t *fpregs, int regno)
 {
 }
 \f
index f8a24bb6e4e5b8bdc7720a62ca8f01bd863e7de8..e2d2af29ce3c7fec18ec6b6d918c413ad2f08cb0 100644 (file)
@@ -242,29 +242,30 @@ old_store_inferior_registers (int regno)
    them as gdb's idea of the current register values. */
 
 void
-supply_gregset (elf_gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
 {
-  elf_greg_t *regp = (elf_greg_t *) gregsetp;
+  const elf_greg_t *regp = (const elf_greg_t *) gregsetp;
   int regi;
 
   for (regi = M68K_D0_REGNUM; regi <= SP_REGNUM; regi++)
-    regcache_raw_supply (current_regcache, regi, (char *) &regp[regmap[regi]]);
-  regcache_raw_supply (current_regcache, PS_REGNUM, (char *) &regp[PT_SR]);
-  regcache_raw_supply (current_regcache, PC_REGNUM, (char *) &regp[PT_PC]);
+    regcache_raw_supply (regcache, regi, &regp[regmap[regi]]);
+  regcache_raw_supply (regcache, PS_REGNUM, &regp[PT_SR]);
+  regcache_raw_supply (regcache, PC_REGNUM, &regp[PT_PC]);
 }
 
 /* Fill register REGNO (if it is a general-purpose register) in
    *GREGSETPS with the value in GDB's register array.  If REGNO is -1,
    do this for all registers.  */
 void
-fill_gregset (elf_gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache,
+             elf_gregset_t *gregsetp, int regno)
 {
   elf_greg_t *regp = (elf_greg_t *) gregsetp;
   int i;
 
   for (i = 0; i < NUM_GREGS; i++)
     if (regno == -1 || regno == i)
-      regcache_raw_collect (current_regcache, i, regp + regmap[i]);
+      regcache_raw_collect (regcache, i, regp + regmap[i]);
 }
 
 #ifdef HAVE_PTRACE_GETREGS
@@ -290,7 +291,7 @@ fetch_regs (int tid)
       perror_with_name (_("Couldn't get registers"));
     }
 
-  supply_gregset (&regs);
+  supply_gregset (current_regcache, (const elf_gregset_t *) &regs);
 }
 
 /* Store all valid general-purpose registers in GDB's register array
@@ -304,7 +305,7 @@ store_regs (int tid, int regno)
   if (ptrace (PTRACE_GETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't get registers"));
 
-  fill_gregset (&regs, regno);
+  fill_gregset (current_regcache, &regs, regno);
 
   if (ptrace (PTRACE_SETREGS, tid, 0, (int) &regs) < 0)
     perror_with_name (_("Couldn't write registers"));
@@ -321,25 +322,22 @@ static void store_regs (int tid, int regno) {}
 /* Transfering floating-point registers between GDB, inferiors and cores.  */
 
 /* What is the address of fpN within the floating-point register set F?  */
-#define FPREG_ADDR(f, n) ((char *) &(f)->fpregs[(n) * 3])
+#define FPREG_ADDR(f, n) (&(f)->fpregs[(n) * 3])
 
 /* Fill GDB's register array with the floating-point register values in
    *FPREGSETP.  */
 
 void
-supply_fpregset (elf_fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp)
 {
   int regi;
 
   for (regi = FP0_REGNUM; regi < FP0_REGNUM + 8; regi++)
-    regcache_raw_supply (current_regcache, regi,
+    regcache_raw_supply (regcache, regi,
                         FPREG_ADDR (fpregsetp, regi - FP0_REGNUM));
-  regcache_raw_supply (current_regcache, M68K_FPC_REGNUM,
-                      (char *) &fpregsetp->fpcntl[0]);
-  regcache_raw_supply (current_regcache, M68K_FPS_REGNUM,
-                      (char *) &fpregsetp->fpcntl[1]);
-  regcache_raw_supply (current_regcache, M68K_FPI_REGNUM,
-                      (char *) &fpregsetp->fpcntl[2]);
+  regcache_raw_supply (regcache, M68K_FPC_REGNUM, &fpregsetp->fpcntl[0]);
+  regcache_raw_supply (regcache, M68K_FPS_REGNUM, &fpregsetp->fpcntl[1]);
+  regcache_raw_supply (regcache, M68K_FPI_REGNUM, &fpregsetp->fpcntl[2]);
 }
 
 /* Fill register REGNO (if it is a floating-point register) in
@@ -347,21 +345,22 @@ supply_fpregset (elf_fpregset_t *fpregsetp)
    do this for all registers.  */
 
 void
-fill_fpregset (elf_fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              elf_fpregset_t *fpregsetp, int regno)
 {
   int i;
 
   /* Fill in the floating-point registers.  */
   for (i = FP0_REGNUM; i < FP0_REGNUM + 8; i++)
     if (regno == -1 || regno == i)
-      regcache_raw_collect (current_regcache, i,
+      regcache_raw_collect (regcache, i,
                            FPREG_ADDR (fpregsetp, i - FP0_REGNUM));
 
   /* Fill in the floating-point control registers.  */
   for (i = M68K_FPC_REGNUM; i <= M68K_FPI_REGNUM; i++)
     if (regno == -1 || regno == i)
-      regcache_raw_collect (current_regcache, i,
-                           (char *) &fpregsetp->fpcntl[i - M68K_FPC_REGNUM]);
+      regcache_raw_collect (regcache, i,
+                           &fpregsetp->fpcntl[i - M68K_FPC_REGNUM]);
 }
 
 #ifdef HAVE_PTRACE_GETREGS
@@ -377,7 +376,7 @@ fetch_fpregs (int tid)
   if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0)
     perror_with_name (_("Couldn't get floating point status"));
 
-  supply_fpregset (&fpregs);
+  supply_fpregset (current_regcache, (const elf_fpregset_t *) &fpregs);
 }
 
 /* Store all valid floating-point registers in GDB's register array
@@ -391,7 +390,7 @@ store_fpregs (int tid, int regno)
   if (ptrace (PTRACE_GETFPREGS, tid, 0, (int) &fpregs) < 0)
     perror_with_name (_("Couldn't get floating point status"));
 
-  fill_fpregset (&fpregs, regno);
+  fill_fpregset (current_regcache, &fpregs, regno);
 
   if (ptrace (PTRACE_SETFPREGS, tid, 0, (int) &fpregs) < 0)
     perror_with_name (_("Couldn't write floating point status"));
@@ -543,7 +542,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
       else
        {
          memcpy (&gregset, core_reg_sect, sizeof (gregset));
-         supply_gregset (&gregset);
+         supply_gregset (current_regcache, (const elf_gregset_t *) &gregset);
        }
       break;
 
@@ -553,7 +552,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
       else
        {
          memcpy (&fpregset, core_reg_sect, sizeof (fpregset));
-         supply_fpregset (&fpregset);
+         supply_fpregset (current_regcache, (const elf_fpregset_t *) &fpregset);
        }
       break;
 
index 62657240afca4999b485cb380cb27de2eb9704fe..f6eaa0b9b3f6ed4c87d0b30c5aac3087ec360b96 100644 (file)
@@ -177,39 +177,41 @@ ps_get_thread_area (const struct ps_prochandle *ph,
 /* Wrapper functions.  These are only used by libthread_db.  */
 
 void
-supply_gregset (gdb_gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
 {
   if (mips_isa_regsize (current_gdbarch) == 4)
-    mips_supply_gregset (current_regcache, (void *) gregsetp);
+    mips_supply_gregset (regcache, (const mips_elf_gregset_t *) gregsetp);
   else
-    mips64_supply_gregset (current_regcache, (void *) gregsetp);
+    mips64_supply_gregset (regcache, (const mips64_elf_gregset_t *) gregsetp);
 }
 
 void
-fill_gregset (gdb_gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache,
+             gdb_gregset_t *gregsetp, int regno)
 {
   if (mips_isa_regsize (current_gdbarch) == 4)
-    mips_fill_gregset (current_regcache, (void *) gregsetp, regno);
+    mips_fill_gregset (regcache, (mips_elf_gregset_t *) gregsetp, regno);
   else
-    mips64_fill_gregset (current_regcache, (void *) gregsetp, regno);
+    mips64_fill_gregset (regcache, (mips64_elf_gregset_t *) gregsetp, regno);
 }
 
 void
-supply_fpregset (gdb_fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
 {
   if (mips_isa_regsize (current_gdbarch) == 4)
-    mips_supply_fpregset (current_regcache, (void *) fpregsetp);
+    mips_supply_fpregset (regcache, (const mips_elf_fpregset_t *) fpregsetp);
   else
-    mips64_supply_fpregset (current_regcache, (void *) fpregsetp);
+    mips64_supply_fpregset (regcache, (const mips64_elf_fpregset_t *) fpregsetp);
 }
 
 void
-fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              gdb_fpregset_t *fpregsetp, int regno)
 {
   if (mips_isa_regsize (current_gdbarch) == 4)
-    mips_fill_fpregset (current_regcache, (void *) fpregsetp, regno);
+    mips_fill_fpregset (regcache, (mips_elf_fpregset_t *) fpregsetp, regno);
   else
-    mips64_fill_fpregset (current_regcache, (void *) fpregsetp, regno);
+    mips64_fill_fpregset (regcache, (mips64_elf_fpregset_t *) fpregsetp, regno);
 }
 
 
index 7cd43a9dff344869bcf8fd1d0f7ae9eaf846ca47..02e50f1d6f88c3808d5ea20a3c64359ef82340df 100644 (file)
@@ -904,30 +904,31 @@ ppc_linux_store_inferior_registers (int regno)
 }
 
 void
-supply_gregset (gdb_gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
 {
   /* NOTE: cagney/2003-11-25: This is the word size used by the ptrace
      interface, and not the wordsize of the program's ABI.  */
   int wordsize = sizeof (long);
-  ppc_linux_supply_gregset (current_regcache, -1, gregsetp,
+  ppc_linux_supply_gregset (regcache, -1, gregsetp,
                            sizeof (gdb_gregset_t), wordsize);
 }
 
 static void
-right_fill_reg (int regnum, void *reg)
+right_fill_reg (const struct regcache *regcache, int regnum, void *reg)
 {
   /* NOTE: cagney/2003-11-25: This is the word size used by the ptrace
      interface, and not the wordsize of the program's ABI.  */
   int wordsize = sizeof (long);
   /* Right fill the register.  */
-  regcache_raw_collect (current_regcache, regnum,
+  regcache_raw_collect (regcache, regnum,
                        ((bfd_byte *) reg
                         + wordsize
                         - register_size (current_gdbarch, regnum)));
 }
 
 void
-fill_gregset (gdb_gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache,
+             gdb_gregset_t *gregsetp, int regno)
 {
   int regi;
   elf_greg_t *regp = (elf_greg_t *) gregsetp;
@@ -941,34 +942,35 @@ fill_gregset (gdb_gregset_t *gregsetp, int regno)
   for (regi = 0; regi < ppc_num_gprs; regi++)
     {
       if ((regno == -1) || regno == tdep->ppc_gp0_regnum + regi)
-       right_fill_reg (tdep->ppc_gp0_regnum + regi, (regp + PT_R0 + regi));
+       right_fill_reg (regcache, tdep->ppc_gp0_regnum + regi,
+                       (regp + PT_R0 + regi));
     }
 
   if ((regno == -1) || regno == PC_REGNUM)
-    right_fill_reg (PC_REGNUM, regp + PT_NIP);
+    right_fill_reg (regcache, PC_REGNUM, regp + PT_NIP);
   if ((regno == -1) || regno == tdep->ppc_lr_regnum)
-    right_fill_reg (tdep->ppc_lr_regnum, regp + PT_LNK);
+    right_fill_reg (regcache, tdep->ppc_lr_regnum, regp + PT_LNK);
   if ((regno == -1) || regno == tdep->ppc_cr_regnum)
-    regcache_raw_collect (current_regcache, tdep->ppc_cr_regnum,
+    regcache_raw_collect (regcache, tdep->ppc_cr_regnum,
                          regp + PT_CCR);
   if ((regno == -1) || regno == tdep->ppc_xer_regnum)
-    regcache_raw_collect (current_regcache, tdep->ppc_xer_regnum,
+    regcache_raw_collect (regcache, tdep->ppc_xer_regnum,
                          regp + PT_XER);
   if ((regno == -1) || regno == tdep->ppc_ctr_regnum)
     right_fill_reg (tdep->ppc_ctr_regnum, regp + PT_CTR);
 #ifdef PT_MQ
   if (((regno == -1) || regno == tdep->ppc_mq_regnum)
       && (tdep->ppc_mq_regnum != -1))
-    right_fill_reg (tdep->ppc_mq_regnum, regp + PT_MQ);
+    right_fill_reg (regcache, tdep->ppc_mq_regnum, regp + PT_MQ);
 #endif
   if ((regno == -1) || regno == tdep->ppc_ps_regnum)
-    right_fill_reg (tdep->ppc_ps_regnum, regp + PT_MSR);
+    right_fill_reg (regcache, tdep->ppc_ps_regnum, regp + PT_MSR);
 }
 
 void
-supply_fpregset (gdb_fpregset_t * fpregsetp)
+supply_fpregset (struct regcache *regcache, const gdb_fpregset_t * fpregsetp)
 {
-  ppc_linux_supply_fpregset (NULL, current_regcache, -1, fpregsetp,
+  ppc_linux_supply_fpregset (NULL, regcache, -1, fpregsetp,
                             sizeof (gdb_fpregset_t));
 }
 
@@ -977,7 +979,8 @@ supply_fpregset (gdb_fpregset_t * fpregsetp)
    idea of the current floating point register set.  If REGNO is -1,
    update them all.  */
 void
-fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              gdb_fpregset_t *fpregsetp, int regno)
 {
   int regi;
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); 
@@ -988,7 +991,7 @@ fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
       for (regi = 0; regi < ppc_num_fprs; regi++)
         {
           if ((regno == -1) || (regno == tdep->ppc_fp0_regnum + regi))
-            regcache_raw_collect (current_regcache, tdep->ppc_fp0_regnum + regi,
+            regcache_raw_collect (regcache, tdep->ppc_fp0_regnum + regi,
                                  fpp + 8 * regi);
         }
       if (regno == -1 || regno == tdep->ppc_fpscr_regnum)
index befcb3b54aec2af94029ab177576817ca2b5318f..a8411f411864772448c6e3d69dac667c01386efa 100644 (file)
@@ -27,6 +27,7 @@
 #include "inferior.h"
 #include "symtab.h"
 #include "target.h"
+#include "regcache.h"
 
 /* Prototypes for supply_gregset etc.  */
 #include "gregset.h"
@@ -234,7 +235,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
   inferior_ptid = BUILD_LWP (lwpid, ph->pid);
 
   target_fetch_registers (-1);
-  fill_gregset ((gdb_gregset_t *) gregset, -1);
+  fill_gregset (current_regcache, (gdb_gregset_t *) gregset, -1);
 
   do_cleanups (old_chain);
   return PS_OK;
@@ -250,8 +251,7 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, const prgregset_t gregset)
 
   inferior_ptid = BUILD_LWP (lwpid, ph->pid);
 
-  /* FIXME: We should really make supply_gregset const-correct.  */
-  supply_gregset ((gdb_gregset_t *) gregset);
+  supply_gregset (current_regcache, (const gdb_gregset_t *) gregset);
   target_store_registers (-1);
 
   do_cleanups (old_chain);
@@ -270,7 +270,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
   inferior_ptid = BUILD_LWP (lwpid, ph->pid);
 
   target_fetch_registers (-1);
-  fill_fpregset ((gdb_fpregset_t *) fpregset, -1);
+  fill_fpregset (current_regcache, (gdb_fpregset_t *) fpregset, -1);
 
   do_cleanups (old_chain);
   return PS_OK;
@@ -287,8 +287,7 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
 
   inferior_ptid = BUILD_LWP (lwpid, ph->pid);
 
-  /* FIXME: We should really make supply_fpregset const-correct.  */
-  supply_fpregset ((gdb_fpregset_t *) fpregset);
+  supply_fpregset (current_regcache, (const gdb_fpregset_t *) fpregset);
   target_store_registers (-1);
 
   do_cleanups (old_chain);
index 1250ff96dced81553e2033f4286b398f4d02227f..a6b43a2cd2756a3b34e4a24cd8bedb5cb4f2aa8d 100644 (file)
@@ -30,6 +30,7 @@ Boston, MA 02110-1301, USA.  */
 #include "elf-bfd.h"           /* for elfcore_write_* */
 #include "gdbcmd.h"
 #include "gdbthread.h"
+#include "regcache.h"
 
 #if defined (NEW_PROC_API)
 #define _STRUCTURED_PROC 1     /* Should be done by configure script. */
@@ -3705,7 +3706,7 @@ procfs_fetch_registers (int regnum)
   if (gregs == NULL)
     proc_error (pi, "fetch_registers, get_gregs", __LINE__);
 
-  supply_gregset (gregs);
+  supply_gregset (current_regcache, (const gdb_gregset_t *) gregs);
 
   if (FP0_REGNUM >= 0)         /* Do we have an FPU?  */
     {
@@ -3720,7 +3721,7 @@ procfs_fetch_registers (int regnum)
       if (fpregs == NULL)
        proc_error (pi, "fetch_registers, get_fpregs", __LINE__);
 
-      supply_fpregset (fpregs);
+      supply_fpregset (current_regcache, (const gdb_fpregset_t *) fpregs);
     }
 }
 
@@ -3773,7 +3774,7 @@ procfs_store_registers (int regnum)
   if (gregs == NULL)
     proc_error (pi, "store_registers, get_gregs", __LINE__);
 
-  fill_gregset (gregs, regnum);
+  fill_gregset (current_regcache, gregs, regnum);
   if (!proc_set_gregs (pi))
     proc_error (pi, "store_registers, set_gregs", __LINE__);
 
@@ -3790,7 +3791,7 @@ procfs_store_registers (int regnum)
       if (fpregs == NULL)
        proc_error (pi, "store_registers, get_fpregs", __LINE__);
 
-      fill_fpregset (fpregs, regnum);
+      fill_fpregset (current_regcache, fpregs, regnum);
       if (!proc_set_fpregs (pi))
        proc_error (pi, "store_registers, set_fpregs", __LINE__);
     }
@@ -6020,7 +6021,7 @@ procfs_do_thread_registers (bfd *obfd, ptid_t ptid,
 
   merged_pid = TIDGET (ptid) << 16 | PIDGET (ptid);
 
-  fill_gregset (&gregs, -1);
+  fill_gregset (current_regcache, &gregs, -1);
 #if defined (UNIXWARE)
   note_data = (char *) elfcore_write_lwpstatus (obfd,
                                                note_data,
@@ -6036,7 +6037,7 @@ procfs_do_thread_registers (bfd *obfd, ptid_t ptid,
                                               stop_signal,
                                               &gregs);
 #endif
-  fill_fpregset (&fpregs, -1);
+  fill_fpregset (current_regcache, &fpregs, -1);
   note_data = (char *) elfcore_write_prfpreg (obfd,
                                              note_data,
                                              note_size,
@@ -6107,7 +6108,7 @@ procfs_make_note_section (bfd *obfd, int *note_size)
                                               psargs);
 
 #ifdef UNIXWARE
-  fill_gregset (&gregs, -1);
+  fill_gregset (current_regcache, &gregs, -1);
   note_data = elfcore_write_pstatus (obfd, note_data, note_size,
                                     PIDGET (inferior_ptid),
                                     stop_signal, &gregs);
index a7ccd747fb52ba3eb0258cf67341ca1ff500d08d..a167bb7279c76de73c71b939a54635346e5f580a 100644 (file)
 /* Fill GDB's register array with the general-purpose register values
    in *REGP.  */
 void
-supply_gregset (gregset_t *regp)
+supply_gregset (struct regcache *regcache, const gregset_t *regp)
 {
   int i;
   for (i = 0; i < S390_NUM_REGS; i++)
     if (regmap_gregset[i] != -1)
-      regcache_raw_supply (current_regcache, i, 
-                          (char *)regp + regmap_gregset[i] + SUBOFF (i));
+      regcache_raw_supply (regcache, i, 
+                          (const char *)regp + regmap_gregset[i] + SUBOFF (i));
 }
 
 /* Fill register REGNO (if it is a general-purpose register) in
    *REGP with the value in GDB's register array.  If REGNO is -1,
    do this for all registers.  */
 void
-fill_gregset (gregset_t *regp, int regno)
+fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno)
 {
   int i;
   for (i = 0; i < S390_NUM_REGS; i++)
     if (regmap_gregset[i] != -1)
       if (regno == -1 || regno == i)
-       regcache_raw_collect (current_regcache, i, 
+       regcache_raw_collect (regcache, i, 
                              (char *)regp + regmap_gregset[i] + SUBOFF (i));
 }
 
 /* Fill GDB's register array with the floating-point register values
    in *REGP.  */
 void
-supply_fpregset (fpregset_t *regp)
+supply_fpregset (struct regcache *regcache, const fpregset_t *regp)
 {
   int i;
   for (i = 0; i < S390_NUM_REGS; i++)
     if (regmap_fpregset[i] != -1)
-      regcache_raw_supply (current_regcache, i,
-                          ((char *)regp) + regmap_fpregset[i]);
+      regcache_raw_supply (regcache, i,
+                          (const char *)regp + regmap_fpregset[i]);
 }
 
 /* Fill register REGNO (if it is a general-purpose register) in
    *REGP with the value in GDB's register array.  If REGNO is -1,
    do this for all registers.  */
 void
-fill_fpregset (fpregset_t *regp, int regno)
+fill_fpregset (const struct regcache *regcache, fpregset_t *regp, int regno)
 {
   int i;
   for (i = 0; i < S390_NUM_REGS; i++)
     if (regmap_fpregset[i] != -1)
       if (regno == -1 || regno == i)
-        regcache_raw_collect (current_regcache, i, 
-                             ((char *)regp) + regmap_fpregset[i]);
+        regcache_raw_collect (regcache, i, 
+                             (char *)regp + regmap_fpregset[i]);
 }
 
 /* Find the TID for the current inferior thread to use with ptrace.  */
@@ -139,7 +139,7 @@ fetch_regs (int tid)
   if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0)
     perror_with_name (_("Couldn't get registers"));
 
-  supply_gregset (&regs);
+  supply_gregset (current_regcache, (const gregset_t *) &regs);
 }
 
 /* Store all valid general-purpose registers in GDB's register cache
@@ -156,7 +156,7 @@ store_regs (int tid, int regnum)
   if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0)
     perror_with_name (_("Couldn't get registers"));
 
-  fill_gregset (&regs, regnum);
+  fill_gregset (current_regcache, &regs, regnum);
 
   if (ptrace (PTRACE_POKEUSR_AREA, tid, (long) &parea) < 0)
     perror_with_name (_("Couldn't write registers"));
@@ -176,7 +176,7 @@ fetch_fpregs (int tid)
   if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0)
     perror_with_name (_("Couldn't get floating point status"));
 
-  supply_fpregset (&fpregs);
+  supply_fpregset (current_regcache, (const fpregset_t *) &fpregs);
 }
 
 /* Store all valid floating-point registers in GDB's register cache
@@ -193,7 +193,7 @@ store_fpregs (int tid, int regnum)
   if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0)
     perror_with_name (_("Couldn't get floating point status"));
 
-  fill_fpregset (&fpregs, regnum);
+  fill_fpregset (current_regcache, &fpregs, regnum);
 
   if (ptrace (PTRACE_POKEUSR_AREA, tid, (long) &parea) < 0)
     perror_with_name (_("Couldn't write floating point status"));
index 518f17f8a3fe6ff7875216be22fb28722accf1a3..bb8d20b6a65af2712ae6cbb8ab7625daf03ab2d1 100644 (file)
@@ -531,8 +531,8 @@ sol_thread_fetch_registers (int regnum)
      calling the td routines because the td routines call ps_lget*
      which affect the values stored in the registers array.  */
 
-  supply_gregset ((gdb_gregset_t *) &gregset);
-  supply_fpregset ((gdb_fpregset_t *) &fpregset);
+  supply_gregset (current_regcache, (const gdb_gregset_t *) &gregset);
+  supply_fpregset (current_regcache, (const gdb_fpregset_t *) &fpregset);
 
 #if 0
   /* FIXME: libthread_db doesn't seem to handle this right.  */
@@ -618,8 +618,8 @@ sol_thread_store_registers (int regnum)
 #endif
     }
 
-  fill_gregset ((gdb_gregset_t *) &gregset, regnum);
-  fill_fpregset ((gdb_fpregset_t *) &fpregset, regnum);
+  fill_gregset (current_regcache, (gdb_gregset_t *) &gregset, regnum);
+  fill_fpregset (current_regcache, (gdb_fpregset_t *) &fpregset, regnum);
 
   val = p_td_thr_setgregs (&thandle, gregset);
   if (val != TD_OK)
@@ -1107,7 +1107,7 @@ ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
     procfs_ops.to_fetch_registers (-1);
   else
     orig_core_ops.to_fetch_registers (-1);
-  fill_gregset ((gdb_gregset_t *) gregset, -1);
+  fill_gregset (current_regcache, (gdb_gregset_t *) gregset, -1);
 
   do_cleanups (old_chain);
 
@@ -1126,7 +1126,7 @@ ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
 
   inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
 
-  supply_gregset ((gdb_gregset_t *) gregset);
+  supply_gregset (current_regcache, (const gdb_gregset_t *) gregset);
   if (target_has_execution)
     procfs_ops.to_store_registers (-1);
   else
@@ -1239,7 +1239,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
     procfs_ops.to_fetch_registers (-1);
   else
     orig_core_ops.to_fetch_registers (-1);
-  fill_fpregset ((gdb_fpregset_t *) fpregset, -1);
+  fill_fpregset (current_regcache, (gdb_fpregset_t *) fpregset, -1);
 
   do_cleanups (old_chain);
 
@@ -1258,7 +1258,7 @@ ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
 
   inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
 
-  supply_fpregset ((gdb_fpregset_t *) fpregset);
+  supply_fpregset (current_regcache, (const gdb_fpregset_t *) fpregset);
   if (target_has_execution)
     procfs_ops.to_store_registers (-1);
   else
index 1e507d27535c0ea68b089bc7a8ed04a34d124b1c..0f63ad6c5102d7098865c67f318b183ffabb7ecf 100644 (file)
 #include "linux-nat.h"
 
 void
-supply_gregset (prgregset_t *gregs)
+supply_gregset (struct regcache *regcache, const prgregset_t *gregs)
 {
-  sparc32_supply_gregset (sparc_gregset, current_regcache, -1, gregs);
+  sparc32_supply_gregset (sparc_gregset, regcache, -1, gregs);
 }
 
 void
-supply_fpregset (prfpregset_t *fpregs)
+supply_fpregset (struct regcache *regcache, const prfpregset_t *fpregs)
 {
-  sparc32_supply_fpregset (current_regcache, -1, fpregs);
+  sparc32_supply_fpregset (regcache, -1, fpregs);
 }
 
 void
-fill_gregset (prgregset_t *gregs, int regnum)
+fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum)
 {
-  sparc32_collect_gregset (sparc_gregset, current_regcache, regnum, gregs);
+  sparc32_collect_gregset (sparc_gregset, regcache, regnum, gregs);
 }
 
 void
-fill_fpregset (prfpregset_t *fpregs, int regnum)
+fill_fpregset (const struct regcache *regcache, prfpregset_t *fpregs, int regnum)
 {
-  sparc32_collect_fpregset (current_regcache, regnum, fpregs);
+  sparc32_collect_fpregset (regcache, regnum, fpregs);
 }
 
 void _initialialize_sparc_linux_nat (void);
index da04b0c27f8d4c4f499034702174c9076e4723e2..e4da7015f3ee14fe2796a2c376cdd1c705099202 100644 (file)
 #endif
 
 void
-supply_gregset (prgregset_t *gregs)
+supply_gregset (struct regcache *regcache, const prgregset_t *gregs)
 {
-  sparc_supply_gregset (&sparc_sol2_gregset, current_regcache, -1, gregs);
+  sparc_supply_gregset (&sparc_sol2_gregset, regcache, -1, gregs);
 }
 
 void
-supply_fpregset (prfpregset_t *fpregs)
+supply_fpregset (struct regcache *regcache, const prfpregset_t *fpregs)
 {
-  sparc_supply_fpregset (current_regcache, -1, fpregs);
+  sparc_supply_fpregset (regcache, -1, fpregs);
 }
 
 void
-fill_gregset (prgregset_t *gregs, int regnum)
+fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum)
 {
-  sparc_collect_gregset (&sparc_sol2_gregset, current_regcache, regnum, gregs);
+  sparc_collect_gregset (&sparc_sol2_gregset, regcache, regnum, gregs);
 }
 
 void
-fill_fpregset (prfpregset_t *fpregs, int regnum)
+fill_fpregset (const struct regcache *regcache, prfpregset_t *fpregs, int regnum)
 {
-  sparc_collect_fpregset (current_regcache, regnum, fpregs);
+  sparc_collect_fpregset (regcache, regnum, fpregs);
 }
index 03c1764fe387ce90a2a1a291383dce1688ae2480..924d639f1c88d5e3458134a925a28a5bf0d39955 100644 (file)
@@ -47,27 +47,28 @@ static const struct sparc_gregset sparc64_linux_ptrace_gregset =
 \f
 
 void
-supply_gregset (prgregset_t *gregs)
+supply_gregset (struct regcache *regcache, const prgregset_t *gregs)
 {
-  sparc64_supply_gregset (sparc_gregset, current_regcache, -1, gregs);
+  sparc64_supply_gregset (sparc_gregset, regcache, -1, gregs);
 }
 
 void
-supply_fpregset (prfpregset_t *fpregs)
+supply_fpregset (struct regcache *regcache, const prfpregset_t *fpregs)
 {
-  sparc64_supply_fpregset (current_regcache, -1, fpregs);
+  sparc64_supply_fpregset (regcache, -1, fpregs);
 }
 
 void
-fill_gregset (prgregset_t *gregs, int regnum)
+fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum)
 {
-  sparc64_collect_gregset (sparc_gregset, current_regcache, regnum, gregs);
+  sparc64_collect_gregset (sparc_gregset, regcache, regnum, gregs);
 }
 
 void
-fill_fpregset (prfpregset_t *fpregs, int regnum)
+fill_fpregset (const struct regcache *regcache,
+              prfpregset_t *fpregs, int regnum)
 {
-  sparc64_collect_fpregset (current_regcache, regnum, fpregs);
+  sparc64_collect_fpregset (regcache, regnum, fpregs);
 }
 
 /* Provide a prototype to silence -Wmissing-prototypes.  */