]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use reg_buffer in target_fetch_registers interface
authorSimon Marchi <simon.marchi@ericsson.com>
Thu, 31 May 2018 00:56:30 +0000 (20:56 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Thu, 31 May 2018 20:02:53 +0000 (16:02 -0400)
94 files changed:
gdb/aarch32-linux-nat.c
gdb/aarch32-linux-nat.h
gdb/aarch64-linux-nat.c
gdb/alpha-linux-tdep.c
gdb/alpha-nbsd-tdep.c
gdb/alpha-tdep.c
gdb/alpha-tdep.h
gdb/amd64-fbsd-tdep.c
gdb/amd64-linux-nat.c
gdb/amd64-linux-tdep.c
gdb/amd64-nat.c
gdb/amd64-nat.h
gdb/amd64-obsd-tdep.c
gdb/amd64-tdep.c
gdb/amd64-tdep.h
gdb/arch-utils.c
gdb/arch-utils.h
gdb/arm-bsd-tdep.c
gdb/arm-linux-tdep.c
gdb/arm-linux-tdep.h
gdb/bsd-uthread.c
gdb/bsd-uthread.h
gdb/corelow.c
gdb/cris-tdep.c
gdb/ctf.c
gdb/fbsd-tdep.c
gdb/frv-linux-tdep.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/gdbcore.h
gdb/hppa-nbsd-tdep.c
gdb/hppa-obsd-tdep.c
gdb/i386-fbsd-tdep.c
gdb/i386-linux-tdep.c
gdb/i386-obsd-tdep.c
gdb/i386-tdep.c
gdb/i387-tdep.c
gdb/i387-tdep.h
gdb/ia64-linux-tdep.c
gdb/inf-child.h
gdb/linux-tdep.c
gdb/m32r-linux-tdep.c
gdb/m68k-bsd-tdep.c
gdb/mips-fbsd-tdep.c
gdb/mips-linux-tdep.c
gdb/mips-nbsd-tdep.c
gdb/mips64-obsd-tdep.c
gdb/mn10300-linux-tdep.c
gdb/nios2-linux-tdep.c
gdb/or1k-tdep.c
gdb/ppc-linux-tdep.c
gdb/ppc-obsd-tdep.c
gdb/ppc-ravenscar-thread.c
gdb/ppc-tdep.h
gdb/proc-service.c
gdb/ravenscar-thread.c
gdb/ravenscar-thread.h
gdb/record-btrace.c
gdb/record-full.c
gdb/regcache.c
gdb/regcache.h
gdb/regset.h
gdb/remote.c
gdb/rs6000-aix-tdep.c
gdb/rs6000-tdep.c
gdb/s390-linux-tdep.c
gdb/s390-tdep.c
gdb/score-tdep.c
gdb/sh-tdep.c
gdb/sparc-linux-tdep.c
gdb/sparc-nbsd-tdep.c
gdb/sparc-obsd-tdep.c
gdb/sparc-ravenscar-thread.c
gdb/sparc-sol2-tdep.c
gdb/sparc-tdep.c
gdb/sparc-tdep.h
gdb/sparc64-fbsd-tdep.c
gdb/sparc64-linux-tdep.c
gdb/sparc64-nbsd-tdep.c
gdb/sparc64-obsd-tdep.c
gdb/sparc64-sol2-tdep.c
gdb/sparc64-tdep.c
gdb/sparc64-tdep.h
gdb/spu-multiarch.c
gdb/target-debug.h
gdb/target-delegates.c
gdb/target.c
gdb/target.h
gdb/tracefile-tfile.c
gdb/tracefile.c
gdb/tracefile.h
gdb/vax-tdep.c
gdb/xtensa-tdep.c

index e390361c7909b7bedc11092659603a8a47470cad..b35ab4db4866271b8b37ff58c7d9beaf290919b3 100644 (file)
@@ -28,7 +28,7 @@
    is true if the 32-bit mode is in use, otherwise, it is false.  */
 
 void
-aarch32_gp_regcache_supply (struct regcache *regcache, uint32_t *regs,
+aarch32_gp_regcache_supply (reg_buffer *regcache, uint32_t *regs,
                            int arm_apcs_32)
 {
   int regno;
@@ -81,7 +81,7 @@ aarch32_gp_regcache_collect (const struct regcache *regcache, uint32_t *regs,
    VFP_REGISTER_COUNT is the number of VFP registers.  */
 
 void
-aarch32_vfp_regcache_supply (struct regcache *regcache, gdb_byte *regs,
+aarch32_vfp_regcache_supply (reg_buffer *regcache, gdb_byte *regs,
                             const int vfp_register_count)
 {
   int regno;
index ac2de376aeb002c556e9fcc85b36c48e4f894f25..9cdd432bfc91ddd34aedc94de009c67cec621cce 100644 (file)
    VFPv3D16 target.  */
 #define VFP_REGS_SIZE (32 * 8 + 4)
 
-void aarch32_gp_regcache_supply (struct regcache *regcache, uint32_t *regs,
+void aarch32_gp_regcache_supply (reg_buffer *regcache, uint32_t *regs,
                                 int arm_apcs_32);
 
 void aarch32_gp_regcache_collect (const struct regcache *regcache,
                                  uint32_t *regs, int arm_apcs_32);
 
-void aarch32_vfp_regcache_supply (struct regcache *regcache, gdb_byte *regs,
+void aarch32_vfp_regcache_supply (reg_buffer *regcache, gdb_byte *regs,
                                  const int vfp_register_count);
 
 void aarch32_vfp_regcache_collect (const struct regcache *regcache,
index 94d18c315a158ea257a8422e1f6e20e33fb762c6..37420d36dc074b2364d07f00147972eef3285086 100644 (file)
@@ -53,7 +53,7 @@ class aarch64_linux_nat_target final : public linux_nat_target
 {
 public:
   /* Add our register access methods.  */
-  void fetch_registers (struct regcache *, int) override;
+  void fetch_registers (ptid_t, reg_buffer *, int) override;
   void store_registers (struct regcache *, int) override;
 
   const struct target_desc *read_description () override;
@@ -197,7 +197,7 @@ aarch64_get_debug_reg_state (pid_t pid)
    from the current thread.  */
 
 static void
-fetch_gregs_from_thread (struct regcache *regcache)
+fetch_gregs_from_thread (ptid_t ptid, reg_buffer *regcache)
 {
   int ret, tid;
   struct gdbarch *gdbarch = regcache->arch ();
@@ -208,7 +208,7 @@ fetch_gregs_from_thread (struct regcache *regcache)
      and arm.  */
   gdb_static_assert (sizeof (regs) >= 18 * 4);
 
-  tid = ptid_get_lwp (regcache->ptid ());
+  tid = ptid.lwp ();
 
   iovec.iov_base = &regs;
   if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
@@ -277,7 +277,7 @@ store_gregs_to_thread (const struct regcache *regcache)
    from the current thread.  */
 
 static void
-fetch_fpregs_from_thread (struct regcache *regcache)
+fetch_fpregs_from_thread (ptid_t ptid, reg_buffer *regcache)
 {
   int ret, tid;
   elf_fpregset_t regs;
@@ -288,7 +288,7 @@ fetch_fpregs_from_thread (struct regcache *regcache)
      and arm.  */
   gdb_static_assert (sizeof regs >= VFP_REGS_SIZE);
 
-  tid = ptid_get_lwp (regcache->ptid ());
+  tid = ptid.lwp ();
 
   iovec.iov_base = &regs;
 
@@ -386,18 +386,18 @@ store_fpregs_to_thread (const struct regcache *regcache)
 /* Implement the "fetch_registers" target_ops method.  */
 
 void
-aarch64_linux_nat_target::fetch_registers (struct regcache *regcache,
+aarch64_linux_nat_target::fetch_registers (ptid_t ptid, reg_buffer *regcache,
                                           int regno)
 {
   if (regno == -1)
     {
-      fetch_gregs_from_thread (regcache);
-      fetch_fpregs_from_thread (regcache);
+      fetch_gregs_from_thread (ptid, regcache);
+      fetch_fpregs_from_thread (ptid, regcache);
     }
   else if (regno < AARCH64_V0_REGNUM)
-    fetch_gregs_from_thread (regcache);
+    fetch_gregs_from_thread (ptid, regcache);
   else
-    fetch_fpregs_from_thread (regcache);
+    fetch_fpregs_from_thread (ptid, regcache);
 }
 
 /* Implement the "store_registers" target_ops method.  */
index 8bacb10aa113b39190af59f0e0ffe10c1a780e95..c5ee53721c591728571051649fe4e2569a381f2f 100644 (file)
@@ -160,7 +160,7 @@ alpha_linux_sigcontext_addr (struct frame_info *this_frame)
 
 static void
 alpha_linux_supply_gregset (const struct regset *regset,
-                           struct regcache *regcache,
+                           reg_buffer *regcache,
                            int regnum, const void *gregs, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) gregs;
@@ -193,7 +193,7 @@ alpha_linux_collect_gregset (const struct regset *regset,
 
 static void
 alpha_linux_supply_fpregset (const struct regset *regset,
-                            struct regcache *regcache,
+                            reg_buffer *regcache,
                             int regnum, const void *fpregs, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) fpregs;
index dffab3fb37fa6b2e9e9e1bbfefed204f76870184..94119f48ea9e4d2e961a972ff48238800a39211f 100644 (file)
@@ -47,7 +47,7 @@
 
 static void
 alphanbsd_supply_fpregset (const struct regset *regset,
-                          struct regcache *regcache,
+                          reg_buffer *regcache,
                           int regnum, const void *fpregs, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) fpregs;
@@ -71,7 +71,7 @@ alphanbsd_supply_fpregset (const struct regset *regset,
 
 static void
 alphanbsd_aout_supply_gregset (const struct regset *regset,
-                              struct regcache *regcache,
+                              reg_buffer *regcache,
                               int regnum, const void *gregs, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) gregs;
@@ -115,7 +115,7 @@ alphanbsd_aout_supply_gregset (const struct regset *regset,
 
 static void
 alphanbsd_supply_gregset (const struct regset *regset,
-                         struct regcache *regcache,
+                         reg_buffer *regcache,
                          int regnum, const void *gregs, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) gregs;
index 53943e1d77a39e70e7f4bc01ba355461ccccb5a5..3ce006e2ad8d860b52868bdc1c2efe0334311739 100644 (file)
@@ -1491,7 +1491,7 @@ alpha_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
    targets don't supply this value in their core files.  */
 
 void
-alpha_supply_int_regs (struct regcache *regcache, int regno,
+alpha_supply_int_regs (reg_buffer *regcache, int regno,
                       const void *r0_r30, const void *pc, const void *unique)
 {
   const gdb_byte *regs = (const gdb_byte *) r0_r30;
@@ -1534,7 +1534,7 @@ alpha_fill_int_regs (const struct regcache *regcache,
 }
 
 void
-alpha_supply_fp_regs (struct regcache *regcache, int regno,
+alpha_supply_fp_regs (reg_buffer *regcache, int regno,
                      const void *f0_f30, const void *fpcr)
 {
   const gdb_byte *regs = (const gdb_byte *) f0_f30;
index 104410ad726f5f490f6b30c83fc4125a34698552..b48358e92cd51045c25e0d600a79130d962ab526 100644 (file)
@@ -110,11 +110,11 @@ extern CORE_ADDR alpha_after_prologue (CORE_ADDR pc);
 extern void alpha_mdebug_init_abi (struct gdbarch_info, struct gdbarch *);
 extern void alpha_dwarf2_init_abi (struct gdbarch_info, struct gdbarch *);
 
-extern void alpha_supply_int_regs (struct regcache *, int, const void *,
+extern void alpha_supply_int_regs (reg_buffer *, int, const void *,
                                   const void *, const void *);
 extern void alpha_fill_int_regs (const struct regcache *, int,
                                 void *, void *, void *);
-extern void alpha_supply_fp_regs (struct regcache *, int,
+extern void alpha_supply_fp_regs (reg_buffer *, int,
                                  const void *, const void *);
 extern void alpha_fill_fp_regs (const struct regcache *,
                                int, void *, void *);
index 9b2ee1365307a5915ab9bcd7d95cb4c9148057e4..6b9ed6466ac76538aa1591c85e60761a4a3cad72 100644 (file)
@@ -163,7 +163,7 @@ amd64fbsd_core_read_description (struct gdbarch *gdbarch,
 
 static void
 amd64fbsd_supply_xstateregset (const struct regset *regset,
-                              struct regcache *regcache, int regnum,
+                              reg_buffer *regcache, int regnum,
                               const void *xstateregs, size_t len)
 {
   amd64_supply_xsave (regcache, regnum, xstateregs);
index 5a39fa87741e8649cfb63b4e670e4e95d47630c9..32ce2cb9cc06ab0d8db670365864086d89333a54 100644 (file)
@@ -48,7 +48,7 @@
 struct amd64_linux_nat_target final : public x86_linux_nat_target
 {
   /* Add our register access methods.  */
-  void fetch_registers (struct regcache *, int) override;
+  void fetch_registers (ptid_t, reg_buffer *, int) override;
   void store_registers (struct regcache *, int) override;
 
   bool low_siginfo_fixup (siginfo_t *ptrace, gdb_byte *inf, int direction)
@@ -142,15 +142,11 @@ fill_fpregset (const struct regcache *regcache,
    registers).  */
 
 void
-amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
+amd64_linux_nat_target::fetch_registers (ptid_t ptid, reg_buffer *regcache,
+                                        int regnum)
 {
   struct gdbarch *gdbarch = regcache->arch ();
-  int tid;
-
-  /* GNU/Linux LWP ID's are process ID's.  */
-  tid = ptid_get_lwp (regcache->ptid ());
-  if (tid == 0)
-    tid = ptid_get_pid (regcache->ptid ()); /* Not a threaded program.  */
+  int tid = get_ptrace_pid (ptid);
 
   if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
     {
index 521e32a9c243fe6a1c8b6c2350f7a7cdde71fd3f..78fdd880881333b958938fd6a485ac43170807c7 100644 (file)
@@ -1617,7 +1617,7 @@ amd64_linux_core_read_description (struct gdbarch *gdbarch,
 
 static void
 amd64_linux_supply_xstateregset (const struct regset *regset,
-                                struct regcache *regcache, int regnum,
+                                reg_buffer *regcache, int regnum,
                                 const void *xstateregs, size_t len)
 {
   amd64_supply_xsave (regcache, regnum, xstateregs);
index 155683c29a3b7011214be18b6ae6af4b8bba8cba..f7795c99bfea8068f5ab8dfdbded28c660835533 100644 (file)
@@ -92,7 +92,7 @@ amd64_native_gregset_supplies_p (struct gdbarch *gdbarch, int regnum)
    REGCACHE.  If REGNUM is -1, supply all appropriate registers.  */
 
 void
-amd64_supply_native_gregset (struct regcache *regcache,
+amd64_supply_native_gregset (reg_buffer *regcache,
                             const void *gregs, int regnum)
 {
   const char *regs = (const char *) gregs;
index 11bddf5c9e4470ec55e1aca04313bd40a487807d..7748239baa2808de577b08f4b4c2abb2719b8a69 100644 (file)
@@ -39,7 +39,7 @@ extern int amd64_native_gregset_supplies_p (struct gdbarch *gdbarch,
 /* Supply register REGNUM, whose contents are store in BUF, to
    REGCACHE.  If REGNUM is -1, supply all appropriate registers.  */
 
-extern void amd64_supply_native_gregset (struct regcache *regcache,
+extern void amd64_supply_native_gregset (reg_buffer *regcache,
                                         const void *gregs, int regnum);
 
 /* Collect register REGNUM from REGCACHE and store its contents in
index 1e078b14f8b2f3d81c2b6d34762c7fb2680792c6..434b837420816f5208c705e724b89e4cba70699f 100644 (file)
@@ -218,7 +218,7 @@ static int amd64obsd_uthread_reg_offset[] =
 #define AMD64OBSD_UTHREAD_RSP_OFFSET   400
 
 static void
-amd64obsd_supply_uthread (struct regcache *regcache,
+amd64obsd_supply_uthread (reg_buffer *regcache,
                          int regnum, CORE_ADDR addr)
 {
   struct gdbarch *gdbarch = regcache->arch ();
index 9f8f018dd155f3f6db3a838e8d582149e5d7854c..7ceadd837155a369be98018b83eaf25542f99cd8 100644 (file)
@@ -2959,7 +2959,7 @@ amd64_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
    REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 static void
-amd64_supply_fpregset (const struct regset *regset, struct regcache *regcache,
+amd64_supply_fpregset (const struct regset *regset, reg_buffer *regcache,
                       int regnum, const void *fpregs, size_t len)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -3335,7 +3335,7 @@ _initialize_amd64_tdep (void)
    reserved bits in *FXSAVE.  */
 
 void
-amd64_supply_fxsave (struct regcache *regcache, int regnum,
+amd64_supply_fxsave (reg_buffer *regcache, int regnum,
                     const void *fxsave)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -3358,7 +3358,7 @@ amd64_supply_fxsave (struct regcache *regcache, int regnum,
 /* Similar to amd64_supply_fxsave, but use XSAVE extended state.  */
 
 void
-amd64_supply_xsave (struct regcache *regcache, int regnum,
+amd64_supply_xsave (reg_buffer *regcache, int regnum,
                    const void *xsave)
 {
   struct gdbarch *gdbarch = regcache->arch ();
index 7d3791ad9368908499ac4ba6c8ec6ca71b222c1a..84a2977d77f221dde96094509f18a1c4691e046a 100644 (file)
@@ -113,11 +113,11 @@ extern const struct target_desc *amd64_target_description (uint64_t xcr0);
    -1, do this for all registers.  This function masks off any of the
    reserved bits in *FXSAVE.  */
 
-extern void amd64_supply_fxsave (struct regcache *regcache, int regnum,
+extern void amd64_supply_fxsave (reg_buffer *regcache, int regnum,
                                 const void *fxsave);
 
 /* Similar to amd64_supply_fxsave, but use XSAVE extended state.  */
-extern void amd64_supply_xsave (struct regcache *regcache, int regnum,
+extern void amd64_supply_xsave (reg_buffer *regcache, int regnum,
                                const void *xsave);
 
 /* Fill register REGNUM (if it is a floating-point or SSE register) in
index 76bc16f3750071a2c06fe52a42efeba3a8c14de2..c32d43b2616b99e857cc1afdb0fca9267789ae75 100644 (file)
@@ -930,7 +930,7 @@ default_addressable_memory_unit_size (struct gdbarch *gdbarch)
 
 void
 default_guess_tracepoint_registers (struct gdbarch *gdbarch,
-                                   struct regcache *regcache,
+                                   reg_buffer *regcache,
                                    CORE_ADDR addr)
 {
   int pc_regno = gdbarch_pc_regnum (gdbarch);
index 77ee9af2bfc9ad2e376071161bdf0b2d6f9279b5..aed7c7297269e407d5cb07fac0ad5376f6d900ce 100644 (file)
@@ -251,7 +251,7 @@ extern const char *default_gnu_triplet_regexp (struct gdbarch *gdbarch);
 extern int default_addressable_memory_unit_size (struct gdbarch *gdbarch);
 
 extern void default_guess_tracepoint_registers (struct gdbarch *gdbarch,
-                                               struct regcache *regcache,
+                                               reg_buffer *regcache,
                                                CORE_ADDR addr);
 
 extern int default_print_insn (bfd_vma memaddr, disassemble_info *info);
index a2719caa4c53e665647463d13e46582a06cebdbb..cf463a570aa1637f06eb8e5c4e8aee06b31a2042 100644 (file)
@@ -47,7 +47,7 @@ armbsd_fpreg_offset (int regnum)
 
 static void
 armbsd_supply_fpregset (const struct regset *regset,
-                       struct regcache *regcache,
+                       reg_buffer *regcache,
                        int regnum, const void *fpregs, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) fpregs;
@@ -68,7 +68,7 @@ armbsd_supply_fpregset (const struct regset *regset,
 
 static void
 armbsd_supply_gregset (const struct regset *regset,
-                      struct regcache *regcache,
+                      reg_buffer *regcache,
                       int regnum, const void *gregs, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) gregs;
index eb4e20659645d95eb7e734fe88f5ed5f0c77ca0f..e6259d240b77f2770286a6a914a0bc38596a330f 100644 (file)
@@ -475,7 +475,7 @@ static struct tramp_frame arm_kernel_linux_restart_syscall_tramp_frame = {
 
 void
 arm_linux_supply_gregset (const struct regset *regset,
-                         struct regcache *regcache,
+                         reg_buffer *regcache,
                          int regnum, const void *gregs_buf, size_t len)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -546,7 +546,7 @@ arm_linux_collect_gregset (const struct regset *regset,
 #define typeExtended           0x03
 
 void
-supply_nwfpe_register (struct regcache *regcache, int regno,
+supply_nwfpe_register (reg_buffer *regcache, int regno,
                       const gdb_byte *regs)
 {
   const gdb_byte *reg_data;
@@ -619,7 +619,7 @@ collect_nwfpe_register (const struct regcache *regcache, int regno,
 
 void
 arm_linux_supply_nwfpe (const struct regset *regset,
-                       struct regcache *regcache,
+                       reg_buffer *regcache,
                        int regnum, const void *regs_buf, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) regs_buf;
@@ -657,7 +657,7 @@ arm_linux_collect_nwfpe (const struct regset *regset,
 
 static void
 arm_linux_supply_vfp (const struct regset *regset,
-                     struct regcache *regcache,
+                     reg_buffer *regcache,
                      int regnum, const void *regs_buf, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) regs_buf;
index 1889c43dcbee673814094a48275c70a3e02698ed..b9624d5661157badc784da3cc42ced569e0b32b5 100644 (file)
@@ -44,7 +44,7 @@ void arm_linux_collect_gregset (const struct regset *regset,
                                const struct regcache *regcache,
                                int regnum, void *gregs_buf, size_t len);
 
-void supply_nwfpe_register (struct regcache *regcache, int regno,
+void supply_nwfpe_register (reg_buffer *regcache, int regno,
                            const gdb_byte *regs);
 void collect_nwfpe_register (const struct regcache *regcache, int regno,
                             gdb_byte *regs);
index 9ead7c2b3dee60def279ea1776a43f51ecd6b963..e13dfc5ca36c35bfce4d1e6e992ac7fc69726a13 100644 (file)
@@ -51,7 +51,7 @@ struct bsd_uthread_target final : public target_ops
 
   void mourn_inferior () override;
 
-  void fetch_registers (struct regcache *, int) override;
+  void fetch_registers (ptid_t, reg_buffer *, int) override;
   void store_registers (struct regcache *, int) override;
 
   ptid_t wait (ptid_t, struct target_waitstatus *, int) override;
@@ -77,7 +77,7 @@ static struct gdbarch_data *bsd_uthread_data;
 struct bsd_uthread_ops
 {
   /* Supply registers for an inactive thread to a register cache.  */
-  void (*supply_uthread)(struct regcache *, int, CORE_ADDR);
+  void (*supply_uthread)(reg_buffer *, int, CORE_ADDR);
 
   /* Collect registers for an inactive thread from a register cache.  */
   void (*collect_uthread)(const struct regcache *, int, CORE_ADDR);
@@ -97,8 +97,8 @@ bsd_uthread_init (struct obstack *obstack)
 
 void
 bsd_uthread_set_supply_uthread (struct gdbarch *gdbarch,
-                               void (*supply_uthread) (struct regcache *,
-                                                       int, CORE_ADDR))
+                               void (*supply_uthread) (reg_buffer *, int,
+                                                       CORE_ADDR))
 {
   struct bsd_uthread_ops *ops
     = (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data);
@@ -316,12 +316,11 @@ bsd_uthread_target::mourn_inferior ()
 }
 
 void
-bsd_uthread_target::fetch_registers (struct regcache *regcache, int regnum)
+bsd_uthread_target::fetch_registers (ptid_t ptid, reg_buffer *regcache, int regnum)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   struct bsd_uthread_ops *uthread_ops
     = (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data);
-  ptid_t ptid = regcache->ptid ();
   CORE_ADDR addr = ptid_get_tid (ptid);
   struct target_ops *beneath = find_target_beneath (this);
   CORE_ADDR active_addr;
@@ -332,7 +331,7 @@ bsd_uthread_target::fetch_registers (struct regcache *regcache, int regnum)
   inferior_ptid = ptid;
 
   /* Always fetch the appropriate registers from the layer beneath.  */
-  beneath->fetch_registers (regcache, regnum);
+  beneath->fetch_registers (ptid, regcache, regnum);
 
   /* FIXME: That might have gotten us more than we asked for.  Make
      sure we overwrite all relevant registers with values from the
index 06eb2c0bb3ce68bdae193e892a7b0c119c258def..1b63e3c6f2332d5319c356328e58768ae1319758 100644 (file)
@@ -24,7 +24,7 @@
    architecture GDBARCH to SUPPLY_UTHREAD.  */
 
 extern void bsd_uthread_set_supply_uthread (struct gdbarch *gdbarch,
-                                   void (*supply_uthread) (struct regcache *,
+                                   void (*supply_uthread) (reg_buffer *,
                                                            int, CORE_ADDR));
 
 
index a81639542b91e99af450af1fcd380cd41c8a490e..41fc7f2ca9e212c0f16a4bbf3de3b2873d7195dc 100644 (file)
@@ -72,7 +72,7 @@ public:
 
   void close () override;
   void detach (inferior *, int) override;
-  void fetch_registers (struct regcache *, int) override;
+  void fetch_registers (ptid_t, reg_buffer *, int) override;
 
   enum target_xfer_status xfer_partial (enum target_object object,
                                        const char *annex,
@@ -103,7 +103,8 @@ public:
   }
 
   /* See definition.  */
-  void get_core_register_section (struct regcache *regcache,
+  void get_core_register_section (ptid_t ptid,
+                                 struct reg_buffer *regcache,
                                  const struct regset *regset,
                                  const char *name,
                                  int min_size,
@@ -517,7 +518,7 @@ core_target_open (const char *arg, int from_tty)
     }
 
   /* Fetch all registers from core file.  */
-  target_fetch_registers (get_current_regcache (), -1);
+  target_fetch_registers (inferior_ptid, get_current_regcache (), -1);
 
   /* Now, set up the frame cache, and print the top of stack.  */
   reinit_frame_cache ();
@@ -569,7 +570,8 @@ core_target::detach (inferior *inf, int from_tty)
    section by the appropriate name.  Otherwise, just do nothing.  */
 
 void
-core_target::get_core_register_section (struct regcache *regcache,
+core_target::get_core_register_section (ptid_t ptid,
+                                       struct reg_buffer *regcache,
                                        const struct regset *regset,
                                        const char *name,
                                        int min_size,
@@ -583,7 +585,7 @@ core_target::get_core_register_section (struct regcache *regcache,
   bool variable_size_section = (regset != NULL
                                && regset->flags & REGSET_VARIABLE_SIZE);
 
-  thread_section_name section_name (name, regcache->ptid ());
+  thread_section_name section_name (name, ptid);
 
   section = bfd_get_section_by_name (core_bfd, section_name.c_str ());
   if (! section)
@@ -632,7 +634,8 @@ core_target::get_core_register_section (struct regcache *regcache,
 struct get_core_registers_cb_data
 {
   core_target *target;
-  struct regcache *regcache;
+  ptid_t ptid;
+  reg_buffer *regcache;
 };
 
 /* Callback for get_core_registers that handles a single core file
@@ -660,8 +663,9 @@ get_core_registers_cb (const char *sect_name, int size,
 
   /* The 'which' parameter is only used when no regset is provided.
      Thus we just set it to -1. */
-  data->target->get_core_register_section (data->regcache, regset, sect_name,
-                                          size, -1, human_name, required);
+  data->target->get_core_register_section (data->ptid, data->regcache, regset,
+                                          sect_name, size, -1, human_name,
+                                          required);
 }
 
 /* Get the registers out of a core file.  This is the machine-
@@ -672,7 +676,7 @@ get_core_registers_cb (const char *sect_name, int size,
 /* We just get all the registers, so we don't use regno.  */
 
 void
-core_target::fetch_registers (struct regcache *regcache, int regno)
+core_target::fetch_registers (ptid_t ptid, reg_buffer *regcache, int regno)
 {
   int i;
   struct gdbarch *gdbarch;
@@ -689,16 +693,16 @@ core_target::fetch_registers (struct regcache *regcache, int regno)
   gdbarch = regcache->arch ();
   if (gdbarch_iterate_over_regset_sections_p (gdbarch))
     {
-      get_core_registers_cb_data data = { this, regcache };
+      get_core_registers_cb_data data = { this, ptid, regcache };
       gdbarch_iterate_over_regset_sections (gdbarch,
                                            get_core_registers_cb,
                                            (void *) &data, NULL);
     }
   else
     {
-      get_core_register_section (regcache, NULL,
+      get_core_register_section (ptid, regcache, NULL,
                                 ".reg", 0, 0, "general-purpose", 1);
-      get_core_register_section (regcache, NULL,
+      get_core_register_section (ptid, regcache, NULL,
                                 ".reg2", 0, 2, "floating-point", 0);
     }
 
index e0371a2a28230249f81737cdb1009c4092c64abb..6dcbe4338829a1955e6f7f9635e0f8beac4ecbcb 100644 (file)
@@ -3798,7 +3798,7 @@ typedef cris_elf_greg_t crisv32_elf_gregset_t[CRISV32_ELF_NGREG];
 /* Unpack a cris_elf_gregset_t into GDB's register cache.  */
 
 static void 
-cris_supply_gregset (struct regcache *regcache, cris_elf_gregset_t *gregsetp)
+cris_supply_gregset (reg_buffer *regcache, cris_elf_gregset_t *gregsetp)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -3829,7 +3829,7 @@ cris_supply_gregset (struct regcache *regcache, cris_elf_gregset_t *gregsetp)
     regsets, until multi-arch core support is ready.  */
 
 static void
-fetch_core_registers (struct regcache *regcache,
+fetch_core_registers (reg_buffer *regcache,
                      char *core_reg_sect, unsigned core_reg_size,
                       int which, CORE_ADDR reg_addr)
 {
index 7e2207484c4458c7721a333ccc1f08b28ac60c64..51446677240d5b1ea7fd497a381a26a72d88e4c2 100644 (file)
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -48,7 +48,7 @@ public:
   { return ctf_target_info; }
 
   void close () override;
-  void fetch_registers (struct regcache *, int) override;
+  void fetch_registers (ptid_t, reg_buffer *, int) override;
   enum target_xfer_status xfer_partial (enum target_object object,
                                                const char *annex,
                                                gdb_byte *readbuf,
@@ -1203,7 +1203,7 @@ ctf_target::files_info ()
    If no matched events are found, mark registers unavailable.  */
 
 void
-ctf_target::fetch_registers (struct regcache *regcache, int regno)
+ctf_target::fetch_registers (ptid_t ptid, reg_buffer *regcache, int regno)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   struct bt_ctf_event *event = NULL;
index e49a9aff09844261dbd07cec7a4bc9a4b2b5d0ac..272d73b84958c5a6e054d107a4e73354da24ad84 100644 (file)
@@ -505,7 +505,7 @@ fbsd_corefile_thread (struct thread_info *info,
 
   regcache = get_thread_arch_regcache (info->ptid, args->gdbarch);
 
-  target_fetch_registers (regcache, -1);
+  target_fetch_registers (info->ptid, regcache, -1);
 
   args->note_data = fbsd_collect_thread_registers
     (regcache, info->ptid, args->obfd, args->note_data,
index c47f1f24f0b479c314e807b389f7661a58c5d5e8..c9522a4c532a37022cd5e99c4a13e741fcc17be4 100644 (file)
@@ -409,7 +409,7 @@ static const struct regcache_map_entry frv_linux_fpregmap[] =
 
 static void 
 frv_linux_supply_gregset (const struct regset *regset,
-                          struct regcache *regcache,
+                         reg_buffer *regcache,
                          int regnum, const void *gregs, size_t len)
 {
   int regi;
index 558cc555b4bd525c61d5f515622525466bc68a75..596d9a4ad9373f57e67b918a073167bf8822e7e2 100644 (file)
@@ -4668,7 +4668,7 @@ set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch,
 }
 
 void
-gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr)
+gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, reg_buffer *regcache, CORE_ADDR addr)
 {
   gdb_assert (gdbarch != NULL);
   gdb_assert (gdbarch->guess_tracepoint_registers != NULL);
index 09edcd5eb2820a8214f0ac3fd6275ca8267f7cd7..35ec19bf6f7608513a10b0e2266820a46c4570f7 100644 (file)
@@ -1376,8 +1376,8 @@ extern void set_gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, gdbar
    allowing us to guess the PC value, and perhaps some other registers.
    On entry, regcache has all registers marked as unavailable. */
 
-typedef void (gdbarch_guess_tracepoint_registers_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
-extern void gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr);
+typedef void (gdbarch_guess_tracepoint_registers_ftype) (struct gdbarch *gdbarch, reg_buffer *regcache, CORE_ADDR addr);
+extern void gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, reg_buffer *regcache, CORE_ADDR addr);
 extern void set_gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, gdbarch_guess_tracepoint_registers_ftype *guess_tracepoint_registers);
 
 /* Return the "auto" target charset. */
index 0a23b1ee0e753675da7d34d2fbbaa68e49360196..aa687aea7186c5d695f56e9e57e730bb656c32f3 100755 (executable)
@@ -1051,7 +1051,7 @@ m;int;fast_tracepoint_valid_at;CORE_ADDR addr, std::string *msg;addr, msg;;defau
 # where no registers have been collected, but there's only one location,
 # allowing us to guess the PC value, and perhaps some other registers.
 # On entry, regcache has all registers marked as unavailable.
-m;void;guess_tracepoint_registers;struct regcache *regcache, CORE_ADDR addr;regcache, addr;;default_guess_tracepoint_registers;;0
+m;void;guess_tracepoint_registers;reg_buffer *regcache, CORE_ADDR addr;regcache, addr;;default_guess_tracepoint_registers;;0
 
 # Return the "auto" target charset.
 f;const char *;auto_charset;void;;default_auto_charset;default_auto_charset;;0
index 18ba0d72267e56763c9f8146f74d6888d95b74dc..8fe20048977ca63d7ecaeae09a201f7245bbc1a2 100644 (file)
@@ -212,7 +212,7 @@ struct core_fns
        registers in a large upage-plus-stack ".reg" section.  Original upage
        address X is at location core_reg_sect+x+reg_addr.  */
 
-    void (*core_read_registers) (struct regcache *regcache,
+    void (*core_read_registers) (reg_buffer *regcache,
                                 char *core_reg_sect,
                                 unsigned core_reg_size,
                                 int which, CORE_ADDR reg_addr);
index f9932b5b805e1d27618946916a4f200071ccc6d4..cd2c8656d2b3c02991e25ede20a02e2dddf523ed 100644 (file)
@@ -160,7 +160,7 @@ static int hppanbsd_reg_offset[] =
 
 static void
 hppanbsd_supply_gregset (const struct regset *regset,
-                        struct regcache *regcache,
+                        reg_buffer *regcache,
                         int regnum, const void *gregs, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) gregs;
index 403e9ddc8279edfb15d1e05297a22d9ca2b25930..e0e47bf0e8b2aecab3d388354e4cb4958ce91d2a 100644 (file)
@@ -40,7 +40,7 @@
 
 static void
 hppaobsd_supply_gregset (const struct regset *regset,
-                        struct regcache *regcache,
+                        reg_buffer *regcache,
                         int regnum, const void *gregs, size_t len)
 {
   gdb_byte zero[4] = { 0 };
@@ -110,7 +110,7 @@ hppaobsd_supply_gregset (const struct regset *regset,
 
 static void
 hppaobsd_supply_fpregset (const struct regset *regset,
-                         struct regcache *regcache,
+                         reg_buffer *regcache,
                          int regnum, const void *fpregs, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) fpregs;
index ebc75a8d58588fb9252f15d4640880d3217a9c4c..1571147952ad9c0c891cb59f4bc47d24f77006ac 100644 (file)
@@ -274,7 +274,7 @@ i386fbsd_core_read_description (struct gdbarch *gdbarch,
 
 static void
 i386fbsd_supply_xstateregset (const struct regset *regset,
-                             struct regcache *regcache, int regnum,
+                             reg_buffer *regcache, int regnum,
                              const void *xstateregs, size_t len)
 {
   i387_supply_xsave (regcache, regnum, xstateregs);
index 1919c8b8cf8102d6af4275e0cad4b3f53893c2d5..3b32ce139dcfe7a2314743de7f1384a078714902 100644 (file)
@@ -723,7 +723,7 @@ i386_linux_core_read_description (struct gdbarch *gdbarch,
 
 static void
 i386_linux_supply_xstateregset (const struct regset *regset,
-                               struct regcache *regcache, int regnum,
+                               reg_buffer *regcache, int regnum,
                                const void *xstateregs, size_t len)
 {
   i387_supply_xsave (regcache, regnum, xstateregs);
index 851fec6024996b39f5a63ff10012946cbe15132d..071846cc490d1571f36151d7647ebef71c9cce4a 100644 (file)
@@ -187,7 +187,7 @@ static int i386obsd_uthread_reg_offset[] =
 #define I386OBSD_UTHREAD_ESP_OFFSET    176
 
 static void
-i386obsd_supply_uthread (struct regcache *regcache,
+i386obsd_supply_uthread (reg_buffer *regcache,
                         int regnum, CORE_ADDR addr)
 {
   struct gdbarch *gdbarch = regcache->arch ();
index b1d502f4827f366582c43e0a4936edc404cbc810..cad9b01a6e1e6552ada93da387cbc2232097e0ed 100644 (file)
@@ -3801,7 +3801,7 @@ i386_value_to_register (struct frame_info *frame, int regnum,
    REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 void
-i386_supply_gregset (const struct regset *regset, struct regcache *regcache,
+i386_supply_gregset (const struct regset *regset, reg_buffer *regcache,
                     int regnum, const void *gregs, size_t len)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -3849,7 +3849,7 @@ i386_collect_gregset (const struct regset *regset,
    REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 static void
-i386_supply_fpregset (const struct regset *regset, struct regcache *regcache,
+i386_supply_fpregset (const struct regset *regset, reg_buffer *regcache,
                      int regnum, const void *fpregs, size_t len)
 {
   struct gdbarch *gdbarch = regcache->arch ();
index d0f64adcbb018a3f3e70d14e23b7d46101be3d65..aa8220760fc45e428d216a1871439d0461026617 100644 (file)
@@ -435,7 +435,7 @@ static int fsave_offset[] =
    *FSAVE.  */
 
 void
-i387_supply_fsave (struct regcache *regcache, int regnum, const void *fsave)
+i387_supply_fsave (reg_buffer *regcache, int regnum, const void *fsave)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -583,7 +583,7 @@ static int i387_tag (const gdb_byte *raw);
    masks off any of the reserved bits in *FXSAVE.  */
 
 void
-i387_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave)
+i387_supply_fxsave (reg_buffer *regcache, int regnum, const void *fxsave)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
   const gdb_byte *regs = (const gdb_byte *) fxsave;
@@ -916,7 +916,7 @@ i387_xsave_get_clear_bv (struct gdbarch *gdbarch, const void *xsave)
 /* Similar to i387_supply_fxsave, but use XSAVE extended state.  */
 
 void
-i387_supply_xsave (struct regcache *regcache, int regnum,
+i387_supply_xsave (reg_buffer *regcache, int regnum,
                   const void *xsave)
 {
   struct gdbarch *gdbarch = regcache->arch ();
index b2fa75aa1222b195a8ff8c3697f48b2ae2c71755..d230c151231da63ef50f7d6ddc1e3f1579aea027 100644 (file)
@@ -120,7 +120,7 @@ extern void i387_value_to_register (struct frame_info *frame, int regnum,
    *FSAVE.  This function masks off any of the reserved bits in
    *FSAVE.  */
 
-extern void i387_supply_fsave (struct regcache *regcache, int regnum,
+extern void i387_supply_fsave (reg_buffer *regcache, int regnum,
                               const void *fsave);
 
 /* Fill register REGNUM (if it is a floating-point register) in *FSAVE
@@ -135,12 +135,12 @@ extern void i387_collect_fsave (const struct regcache *regcache, int regnum,
    floating-point or SSE register value from *FXSAVE.  This function
    masks off any of the reserved bits in *FXSAVE.  */
 
-extern void i387_supply_fxsave (struct regcache *regcache, int regnum,
+extern void i387_supply_fxsave (reg_buffer *regcache, int regnum,
                                const void *fxsave);
 
 /* Similar to i387_supply_fxsave, but use XSAVE extended state.  */
 
-extern void i387_supply_xsave (struct regcache *regcache, int regnum,
+extern void i387_supply_xsave (reg_buffer *regcache, int regnum,
                               const void *xsave);
 
 /* Fill register REGNUM (if it is a floating-point or SSE register) in
index 19d0cf2debfd4f6854bc8034610ef1b6d1d27be6..37c8f09baaffeeac2ea3260a51aba3ad6da66b57 100644 (file)
@@ -171,7 +171,7 @@ static const struct regcache_map_entry ia64_linux_fpregmap[] =
 
 static void
 ia64_linux_supply_fpregset (const struct regset *regset,
-                           struct regcache *regcache,
+                           reg_buffer *regcache,
                            int regnum, const void *regs, size_t len)
 {
   const gdb_byte f_zero[16] = { 0 };
index 6316f3062da106d9257b23319509770cb821e2fa..00f812c5089fd4f919d1ec8cea791b1ed888f1c0 100644 (file)
@@ -38,7 +38,7 @@ public:
 
   void disconnect (const char *, int) override;
 
-  void fetch_registers (struct regcache *, int) override = 0;
+  void fetch_registers (ptid_t, reg_buffer *, int) override = 0;
   void store_registers (struct regcache *, int) override = 0;
 
   void prepare_to_store (struct regcache *) override;
index 4d3919df3187e14512ba071148369f3451662355..68dcaae88a8460748a9236cbd22fb2ffdfe471b2 100644 (file)
@@ -1689,7 +1689,7 @@ linux_corefile_thread (struct thread_info *info,
 
   regcache = get_thread_arch_regcache (info->ptid, args->gdbarch);
 
-  target_fetch_registers (regcache, -1);
+  target_fetch_registers (info->ptid, regcache, -1);
   gdb::byte_vector siginfo_data = linux_get_siginfo_data (info, args->gdbarch);
 
   args->note_data = linux_collect_thread_registers
index be35b699c214ba019905568ff5638ef061e1bad0..c5d6802b31308a7c10f90b23d9824d09c62b53b0 100644 (file)
@@ -348,7 +348,7 @@ static int m32r_pt_regs_offset[] = {
 
 static void
 m32r_linux_supply_gregset (const struct regset *regset,
-                          struct regcache *regcache, int regnum,
+                          reg_buffer *regcache, int regnum,
                           const void *gregs, size_t size)
 {
   const gdb_byte *regs = (const gdb_byte *) gregs;
index 2f53870b98db45cdc9235ebfeb3b069743e9df6e..893f75c682e0ffef77f6f6e5744acc70b77f4461 100644 (file)
@@ -55,7 +55,7 @@ m68kbsd_fpreg_offset (struct gdbarch *gdbarch, int regnum)
 
 static void
 m68kbsd_supply_fpregset (const struct regset *regset,
-                        struct regcache *regcache,
+                        reg_buffer *regcache,
                         int regnum, const void *fpregs, size_t len)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -77,7 +77,7 @@ m68kbsd_supply_fpregset (const struct regset *regset,
 
 static void
 m68kbsd_supply_gregset (const struct regset *regset,
-                       struct regcache *regcache,
+                       reg_buffer *regcache,
                        int regnum, const void *gregs, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) gregs;
index c3075b23fc1ae1bc6523d1a543da33e15fff6288..cb36b13e5e81d353215bd1235607025354da5f52 100644 (file)
@@ -47,7 +47,7 @@
    regcache->raw_supply_integer ().  */
 
 static void
-mips_fbsd_supply_reg (struct regcache *regcache, int regnum, const void *addr,
+mips_fbsd_supply_reg (reg_buffer *regcache, int regnum, const void *addr,
                      size_t len)
 {
   regcache->raw_supply_integer (regnum, (const gdb_byte *) addr, len, true);
@@ -68,7 +68,7 @@ mips_fbsd_collect_reg (const struct regcache *regcache, int regnum, void *addr,
    length.  */
 
 void
-mips_fbsd_supply_fpregs (struct regcache *regcache, int regnum,
+mips_fbsd_supply_fpregs (reg_buffer *regcache, int regnum,
                         const void *fpregs, size_t regsize)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -97,7 +97,7 @@ mips_fbsd_supply_fpregs (struct regcache *regcache, int regnum,
    length.  */
 
 void
-mips_fbsd_supply_gregs (struct regcache *regcache, int regnum,
+mips_fbsd_supply_gregs (reg_buffer *regcache, int regnum,
                        const void *gregs, size_t regsize)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -159,7 +159,7 @@ mips_fbsd_collect_gregs (const struct regcache *regcache, int regnum,
 
 static void
 mips_fbsd_supply_fpregset (const struct regset *regset,
-                          struct regcache *regcache,
+                          reg_buffer *regcache,
                           int regnum, const void *fpregs, size_t len)
 {
   size_t regsize = mips_abi_regsize (regcache->arch ());
@@ -192,7 +192,7 @@ mips_fbsd_collect_fpregset (const struct regset *regset,
 
 static void
 mips_fbsd_supply_gregset (const struct regset *regset,
-                         struct regcache *regcache, int regnum,
+                         reg_buffer *regcache, int regnum,
                          const void *gregs, size_t len)
 {
   size_t regsize = mips_abi_regsize (regcache->arch ());
index 30d5feb56d165eff6d95e6890921c226eb219b76..556a65b8f0a8303052f4bf17de3d1fa58df42ec4 100644 (file)
@@ -119,7 +119,7 @@ mips_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
    is 8.  */
 
 static void
-supply_32bit_reg (struct regcache *regcache, int regnum, const void *addr)
+supply_32bit_reg (reg_buffer *regcache, int regnum, const void *addr)
 {
   regcache->raw_supply_integer (regnum, (const gdb_byte *) addr, 4, true);
 }
@@ -127,7 +127,7 @@ supply_32bit_reg (struct regcache *regcache, int regnum, const void *addr)
 /* Unpack an elf_gregset_t into GDB's register cache.  */
 
 void
-mips_supply_gregset (struct regcache *regcache,
+mips_supply_gregset (reg_buffer *regcache,
                     const mips_elf_gregset_t *gregsetp)
 {
   int regi;
@@ -157,7 +157,7 @@ mips_supply_gregset (struct regcache *regcache,
 
 static void
 mips_supply_gregset_wrapper (const struct regset *regset,
-                            struct regcache *regcache,
+                            reg_buffer *regcache,
                             int regnum, const void *gregs, size_t len)
 {
   gdb_assert (len >= sizeof (mips_elf_gregset_t));
@@ -276,7 +276,7 @@ mips64_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
 /* Supply a 64-bit register.  */
 
 static void
-supply_64bit_reg (struct regcache *regcache, int regnum,
+supply_64bit_reg (reg_buffer *regcache, int regnum,
                  const gdb_byte *buf)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -290,7 +290,7 @@ supply_64bit_reg (struct regcache *regcache, int regnum,
 /* Unpack a 64-bit elf_gregset_t into GDB's register cache.  */
 
 void
-mips64_supply_gregset (struct regcache *regcache,
+mips64_supply_gregset (reg_buffer *regcache,
                       const mips64_elf_gregset_t *gregsetp)
 {
   int regi;
@@ -325,7 +325,7 @@ mips64_supply_gregset (struct regcache *regcache,
 
 static void
 mips64_supply_gregset_wrapper (const struct regset *regset,
-                              struct regcache *regcache,
+                              reg_buffer *regcache,
                               int regnum, const void *gregs, size_t len)
 {
   gdb_assert (len >= sizeof (mips64_elf_gregset_t));
@@ -409,7 +409,7 @@ mips64_fill_gregset_wrapper (const struct regset *regset,
    MIPS I FP context layout").  */
 
 void
-mips64_supply_fpregset (struct regcache *regcache,
+mips64_supply_fpregset (reg_buffer *regcache,
                        const mips64_elf_fpregset_t *fpregsetp)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -442,7 +442,7 @@ mips64_supply_fpregset (struct regcache *regcache,
 
 static void
 mips64_supply_fpregset_wrapper (const struct regset *regset,
-                               struct regcache *regcache,
+                               reg_buffer *regcache,
                                int regnum, const void *gregs, size_t len)
 {
   gdb_assert (len >= sizeof (mips64_elf_fpregset_t));
index 5f4db87498e7fec5e1d448bf5a50c9b3cce52d4c..5dd0b8fb6d0487fa0b9229ab213c4126cdcd8c10 100644 (file)
@@ -52,7 +52,7 @@
 
 static void
 mipsnbsd_supply_fpregset (const struct regset *regset,
-                         struct regcache *regcache,
+                         reg_buffer *regcache,
                          int regnum, const void *fpregs, size_t len)
 {
   size_t regsize = mips_isa_regsize (regcache->arch ());
@@ -74,7 +74,7 @@ mipsnbsd_supply_fpregset (const struct regset *regset,
 
 static void
 mipsnbsd_supply_gregset (const struct regset *regset,
-                        struct regcache *regcache, int regnum,
+                        reg_buffer *regcache, int regnum,
                         const void *gregs, size_t len)
 {
   size_t regsize = mips_isa_regsize (regcache->arch ());
index ab910edfc4ce08f7ba8aeb9db2bd7e0340a2fd4f..68a95321d859126a9b9da2fad552c107ba66eb41 100644 (file)
@@ -43,7 +43,7 @@
 
 static void
 mips64obsd_supply_gregset (const struct regset *regset,
-                          struct regcache *regcache, int regnum,
+                          reg_buffer *regcache, int regnum,
                           const void *gregs, size_t len)
 {
   const char *regs = (const char *) gregs;
index 070fb205fca3efc31551dec71736a14adefd19ca..78c9e9397b76230557cbe9050294449d40ee1d76 100644 (file)
@@ -83,7 +83,7 @@ typedef struct
 
 static void
 am33_supply_gregset_method (const struct regset *regset, 
-                           struct regcache *regcache, 
+                           reg_buffer *regcache,
                            int regnum, const void *gregs, size_t len)
 {
   const mn10300_elf_greg_t *regp = (const mn10300_elf_greg_t *) gregs;
@@ -233,7 +233,7 @@ am33_supply_gregset_method (const struct regset *regset,
 
 static void
 am33_supply_fpregset_method (const struct regset *regset, 
-                            struct regcache *regcache, 
+                            reg_buffer *regcache,
                             int regnum, const void *fpregs, size_t len)
 {
   const mn10300_elf_fpregset_t *fpregset
index e7f4ecf16e2ce100bcb294ceea9a9fef7fd62de7..e4f9f8003e781ea969e0f34aee1b8ef0a6c11733 100644 (file)
@@ -56,7 +56,7 @@ static const int reg_offsets[NIOS2_NUM_REGS] =
 
 static void
 nios2_supply_gregset (const struct regset *regset,
-                     struct regcache *regcache,
+                     reg_buffer *regcache,
                      int regnum, const void *gregs_buf, size_t len)
 {
   const gdb_byte *gregs = (const gdb_byte *) gregs_buf;
index c5104e3959d71eb60596a29a40987a4a8a8565a9..e7cfd43ffc7b5cfb3598d780b1aeb213920f307f 100644 (file)
@@ -610,7 +610,7 @@ or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
   struct type *func_type = value_type (function);
 
   /* Return address */
-  regcache_cooked_write_unsigned (regcache, OR1K_LR_REGNUM, bp_addr);
+  regcache->cooked_write (OR1K_LR_REGNUM, bp_addr);
 
   /* Register for the next argument.  */
   argreg = OR1K_FIRST_ARG_REGNUM;
@@ -619,8 +619,7 @@ or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
      argument.  */
   if (struct_return)
     {
-      regcache_cooked_write_unsigned (regcache, OR1K_FIRST_ARG_REGNUM,
-                                     struct_addr);
+      regcache->cooked_write (OR1K_FIRST_ARG_REGNUM, struct_addr);
       argreg++;
     }
 
@@ -685,8 +684,8 @@ or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
              ULONGEST lo = regval & mask;
              ULONGEST hi = regval >> bits_per_word;
 
-             regcache_cooked_write_unsigned (regcache, argreg, hi);
-             regcache_cooked_write_unsigned (regcache, argreg + 1, lo);
+             regcache->cooked_write (argreg, hi);
+             regcache->cooked_write (argreg + 1, lo);
              argreg += 2;
            }
          else
@@ -698,9 +697,8 @@ or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
       else if (argreg <= OR1K_LAST_ARG_REGNUM)
        {
          /* Smaller scalars fit in a single register.  */
-         regcache_cooked_write_unsigned
-           (regcache, argreg, extract_unsigned_integer (val, len,
-                                                        byte_order));
+         regcache->cooked_write
+           (argreg, extract_unsigned_integer (val, len, byte_order));
          argreg++;
        }
       else
@@ -781,7 +779,7 @@ or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
     }
 
   /* Save the updated stack pointer.  */
-  regcache_cooked_write_unsigned (regcache, OR1K_SP_REGNUM, sp);
+  regcache->cooked_write (OR1K_SP_REGNUM, sp);
 
   if (heap_offset > 0)
     sp = heap_sp;
index c114bee23c9d4f46ffcb9669ba0399b8823dbf47..679d2a1264a3236649799a7ff347551de6f169ea 100644 (file)
@@ -390,7 +390,7 @@ ppc_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
 
 static void
 ppc_linux_supply_gregset (const struct regset *regset,
-                         struct regcache *regcache,
+                         reg_buffer *regcache,
                          int regnum, const void *gregs, size_t len)
 {
   const struct ppc_reg_offsets *offsets
index 838783111a251a6ab599c9af75fe8e4556f445a5..c3313f5d37df9fd973dc39fb1ff902b9b53c1f70 100644 (file)
@@ -45,7 +45,7 @@ struct ppc_reg_offsets ppcobsd_fpreg_offsets;
 
 void
 ppcobsd_supply_gregset (const struct regset *regset,
-                       struct regcache *regcache, int regnum,
+                       reg_buffer *regcache, int regnum,
                        const void *gregs, size_t len)
 {
   ppc_supply_gregset (regset, regcache, regnum, gregs, len);
index 7b83e451ff27718c9a094d6fd5c9a26b7eb90cc8..408df214b980c4f631be2c0b7148bc04be577126 100644 (file)
@@ -116,7 +116,7 @@ struct ravenscar_reg_info
    regcache.  */
 
 static void
-supply_register_at_address (struct regcache *regcache, int regnum,
+supply_register_at_address (reg_buffer *regcache, int regnum,
                             CORE_ADDR register_addr)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -144,8 +144,8 @@ register_in_thread_descriptor_p (const struct ravenscar_reg_info *reg_info,
 
 static void
 ppc_ravenscar_generic_fetch_registers
-  (const struct ravenscar_reg_info *reg_info,
-   struct regcache *regcache, int regnum)
+  (const struct ravenscar_reg_info *reg_info, ptid_t ptid,
+   reg_buffer *regcache, int regnum)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   const int num_regs = gdbarch_num_regs (gdbarch);
@@ -215,9 +215,10 @@ static const struct ravenscar_reg_info ppc_reg_info =
    for most PowerPC targets.  */
 
 static void
-ppc_ravenscar_powerpc_fetch_registers (struct regcache *regcache, int regnum)
+ppc_ravenscar_powerpc_fetch_registers (ptid_t ptid, reg_buffer *regcache,
+                                      int regnum)
 {
-  ppc_ravenscar_generic_fetch_registers (&ppc_reg_info, regcache, regnum);
+  ppc_ravenscar_generic_fetch_registers (&ppc_reg_info, ptid, regcache, regnum);
 }
 
 /* Implement the to_store_registers ravenscar_arch_ops method
@@ -258,9 +259,11 @@ static const struct ravenscar_reg_info e500_reg_info =
    for E500 targets.  */
 
 static void
-ppc_ravenscar_e500_fetch_registers (struct regcache *regcache, int regnum)
+ppc_ravenscar_e500_fetch_registers (ptid_t ptid, reg_buffer *regcache,
+                                   int regnum)
 {
-  ppc_ravenscar_generic_fetch_registers (&e500_reg_info, regcache, regnum);
+  ppc_ravenscar_generic_fetch_registers (&e500_reg_info, ptid, regcache,
+                                        regnum);
 }
 
 /* Implement the to_store_registers ravenscar_arch_ops method
index c3571cbd51bdcfe4a234f4f524d4a535f6b4dc28..64fe02d81ccbfed5ee18f8caab1ae02473a3c56d 100644 (file)
@@ -102,7 +102,7 @@ struct ppc_reg_offsets
   int fpscr_size;
 };
 
-extern void ppc_supply_reg (struct regcache *regcache, int regnum,
+extern void ppc_supply_reg (reg_buffer *regcache, int regnum,
                            const gdb_byte *regs, size_t offset, int regsize);
 
 extern void ppc_collect_reg (const struct regcache *regcache, int regnum,
@@ -113,7 +113,7 @@ extern void ppc_collect_reg (const struct regcache *regcache, int regnum,
    REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 extern void ppc_supply_gregset (const struct regset *regset,
-                               struct regcache *regcache,
+                               reg_buffer *regcache,
                                int regnum, const void *gregs, size_t len);
 
 /* Supply register REGNUM in the floating-point register set REGSET
@@ -121,7 +121,7 @@ extern void ppc_supply_gregset (const struct regset *regset,
    REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 extern void ppc_supply_fpregset (const struct regset *regset,
-                                struct regcache *regcache,
+                                reg_buffer *regcache,
                                 int regnum, const void *fpregs, size_t len);
 
 /* Supply register REGNUM in the Altivec register set REGSET
index 8afa667a06af8776938f3daa626bb6637c6370f5..06c927b2b37061a773bf033fd8f519a93a27baea 100644 (file)
@@ -135,7 +135,7 @@ ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset)
   struct regcache *regcache
     = get_thread_arch_regcache (ptid, target_gdbarch ());
 
-  target_fetch_registers (regcache, -1);
+  target_fetch_registers (ptid, regcache, -1);
   fill_gregset (regcache, (gdb_gregset_t *) gregset, -1);
 
   return PS_OK;
@@ -167,7 +167,7 @@ ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, gdb_prfpregset_t *fpregs
   struct regcache *regcache
     = get_thread_arch_regcache (ptid, target_gdbarch ());
 
-  target_fetch_registers (regcache, -1);
+  target_fetch_registers (ptid, regcache, -1);
   fill_fpregset (regcache, (gdb_fpregset_t *) fpregset, -1);
 
   return PS_OK;
index b8630c3f3a185778f2dbe133557b2087015c1ad7..31a975cacf33559c924d271e4110e78772384290 100644 (file)
@@ -90,7 +90,7 @@ struct ravenscar_thread_target final : public target_ops
   ptid_t wait (ptid_t, struct target_waitstatus *, int) override;
   void resume (ptid_t, int, enum gdb_signal) override;
 
-  void fetch_registers (struct regcache *, int) override;
+  void fetch_registers (ptid_t, reg_buffer *, int) override;
   void store_registers (struct regcache *, int) override;
 
   void prepare_to_store (struct regcache *) override;
@@ -413,10 +413,10 @@ ravenscar_thread_target::pid_to_str (ptid_t ptid)
 }
 
 void
-ravenscar_thread_target::fetch_registers (struct regcache *regcache, int regnum)
+ravenscar_thread_target::fetch_registers (ptid_t ptid, reg_buffer *regcache,
+                                         int regnum)
 {
   struct target_ops *beneath = find_target_beneath (this);
-  ptid_t ptid = regcache->ptid ();
 
   if (ravenscar_runtime_initialized ()
       && is_ravenscar_task (ptid)
@@ -426,10 +426,10 @@ ravenscar_thread_target::fetch_registers (struct regcache *regcache, int regnum)
       struct ravenscar_arch_ops *arch_ops
        = gdbarch_ravenscar_ops (gdbarch);
 
-      arch_ops->to_fetch_registers (regcache, regnum);
+      arch_ops->to_fetch_registers (ptid, regcache, regnum);
     }
   else
-    beneath->fetch_registers (regcache, regnum);
+    beneath->fetch_registers (ptid, regcache, regnum);
 }
 
 void
index a52f7f67b7cf8dd678f9d325ca19c1da244c7e80..6d1bbb7fbb005ba52fd02fab879d962df6314a86 100644 (file)
@@ -24,7 +24,7 @@
 
 struct ravenscar_arch_ops
 {
-  void (*to_fetch_registers) (struct regcache *, int);
+  void (*to_fetch_registers) (ptid_t, reg_buffer *, int);
   void (*to_store_registers) (struct regcache *, int);
   void (*to_prepare_to_store) (struct regcache *);
 };
index 47a31b74ae753cd3ba93944af6d48be239870255..03fc2538448b9f1c21289eac1db6cb5a5c7fb620 100644 (file)
@@ -104,7 +104,7 @@ public:
   int remove_breakpoint (struct gdbarch *, struct bp_target_info *,
                         enum remove_bp_reason) override;
 
-  void fetch_registers (struct regcache *, int) override;
+  void fetch_registers (ptid_t, reg_buffer *, int) override;
 
   void store_registers (struct regcache *, int) override;
   void prepare_to_store (struct regcache *) override;
@@ -1531,12 +1531,12 @@ record_btrace_target::remove_breakpoint (struct gdbarch *gdbarch,
 /* The fetch_registers method of target record-btrace.  */
 
 void
-record_btrace_target::fetch_registers (struct regcache *regcache, int regno)
+record_btrace_target::fetch_registers (ptid_t ptid, reg_buffer *regcache, int regno)
 {
   struct btrace_insn_iterator *replay;
   struct thread_info *tp;
 
-  tp = find_thread_ptid (regcache->ptid ());
+  tp = find_thread_ptid (ptid);
   gdb_assert (tp != NULL);
 
   replay = tp->btrace.replay;
@@ -1561,7 +1561,7 @@ record_btrace_target::fetch_registers (struct regcache *regcache, int regno)
       regcache->raw_supply (regno, &insn->pc);
     }
   else
-    this->beneath->fetch_registers (regcache, regno);
+    this->beneath->fetch_registers (ptid, regcache, regno);
 }
 
 /* The store_registers method of target record-btrace.  */
index bf65701fb7816b124d0397c2fb5cbc72cc49e26b..d14e21ddcc9de8ee1afc4bb001501ec8ccbabb15 100644 (file)
@@ -304,7 +304,7 @@ public:
   void resume (ptid_t, int, enum gdb_signal) override;
   void disconnect (const char *, int) override;
   void kill () override;
-  void fetch_registers (struct regcache *regcache, int regno) override;
+  void fetch_registers (ptid_t ptid, reg_buffer *regcache, int regno) override;
   void prepare_to_store (struct regcache *regcache) override;
   void store_registers (struct regcache *, int) override;
   enum target_xfer_status xfer_partial (enum target_object object,
@@ -919,7 +919,7 @@ record_full_core_open_1 (const char *name, int from_tty)
   int i;
 
   /* Get record_full_core_regbuf.  */
-  target_fetch_registers (regcache, -1);
+  target_fetch_registers (regcache->ptid (), regcache, -1);
   record_full_core_regbuf = new detached_regcache (regcache->arch (), false);
 
   for (i = 0; i < regnum; i ++)
@@ -2099,7 +2099,7 @@ record_full_core_target::kill ()
 /* "fetch_registers" method for prec over corefile.  */
 
 void
-record_full_core_target::fetch_registers (struct regcache *regcache,
+record_full_core_target::fetch_registers (ptid_t ptid, reg_buffer *regcache,
                                          int regno)
 {
   if (regno < 0)
index 0a06b9f0096b7f7f2918179efd1133e499314d53..d75b3052e4777600ce08fa7e397e5e0c8a9613d0 100644 (file)
@@ -494,7 +494,7 @@ regcache::raw_update (int regnum)
 
   if (get_register_status (regnum) == REG_UNKNOWN)
     {
-      target_fetch_registers (this, regnum);
+      target_fetch_registers (this->ptid (), this, regnum);
 
       /* A number of targets can't access the whole set of raw
         registers (because the debug API provides no means to get at
@@ -991,10 +991,10 @@ reg_buffer::raw_collect_integer (int regnum, gdb_byte *addr, int addr_len,
 }
 
 void
-regcache::transfer_regset (const struct regset *regset,
-                          struct regcache *out_regcache,
-                          int regnum, const void *in_buf,
-                          void *out_buf, size_t size) const
+reg_buffer::transfer_regset (const struct regset *regset,
+                            struct reg_buffer *out_regcache,
+                            int regnum, const void *in_buf,
+                            void *out_buf, size_t size) const
 {
   const struct regcache_map_entry *map;
   int offs = 0, count;
@@ -1051,15 +1051,15 @@ regcache::transfer_regset (const struct regset *regset,
 
 void
 regcache_supply_regset (const struct regset *regset,
-                       struct regcache *regcache,
+                       reg_buffer *regcache,
                        int regnum, const void *buf, size_t size)
 {
   regcache->supply_regset (regset, regnum, buf, size);
 }
 
 void
-regcache::supply_regset (const struct regset *regset,
-                        int regnum, const void *buf, size_t size)
+reg_buffer::supply_regset (const struct regset *regset,
+                          int regnum, const void *buf, size_t size)
 {
   transfer_regset (regset, this, regnum, buf, NULL, size);
 }
@@ -1077,7 +1077,7 @@ regcache_collect_regset (const struct regset *regset,
 }
 
 void
-regcache::collect_regset (const struct regset *regset,
+reg_buffer::collect_regset (const struct regset *regset,
                         int regnum, void *buf, size_t size) const
 {
   transfer_regset (regset, NULL, regnum, NULL, buf, size);
@@ -1139,7 +1139,7 @@ reg_buffer::num_raw_registers () const
 }
 
 void
-regcache::debug_print_register (const char *func,  int regno)
+reg_buffer::debug_print_register (const char *func,  int regno)
 {
   struct gdbarch *gdbarch = arch ();
 
@@ -1388,7 +1388,7 @@ public:
     xfer_partial_called = 0;
   }
 
-  void fetch_registers (regcache *regs, int regno) override;
+  void fetch_registers (ptid_t ptid, reg_buffer *regs, int regno) override;
   void store_registers (regcache *regs, int regno) override;
 
   enum target_xfer_status xfer_partial (enum target_object object,
@@ -1403,7 +1403,8 @@ public:
 };
 
 void
-target_ops_no_register::fetch_registers (regcache *regs, int regno)
+target_ops_no_register::fetch_registers (ptid_t ptid, reg_buffer *regs,
+                                        int regno)
 {
   /* Mark register available.  */
   regs->raw_supply_zeroed (regno);
index 23018fce8e19056660a1b56869667d13063329c7..f84138f543953abc2e63d92dc2f9d5b7a7764d70 100644 (file)
@@ -95,24 +95,6 @@ enum
     REGCACHE_MAP_SKIP = -1,
   };
 
-/* Transfer a set of registers (as described by REGSET) between
-   REGCACHE and BUF.  If REGNUM == -1, transfer all registers
-   belonging to the regset, otherwise just the register numbered
-   REGNUM.  The REGSET's 'regmap' field must point to an array of
-   'struct regcache_map_entry'.
-
-   These functions are suitable for the 'regset_supply' and
-   'regset_collect' fields in a regset structure.  */
-
-extern void regcache_supply_regset (const struct regset *regset,
-                                   struct regcache *regcache,
-                                   int regnum, const void *buf,
-                                   size_t size);
-extern void regcache_collect_regset (const struct regset *regset,
-                                    const struct regcache *regcache,
-                                    int regnum, void *buf, size_t size);
-
-
 /* The type of a register.  This function is slightly more efficient
    then its gdbarch vector counterpart since it returns a precomputed
    value stored in a table.  */
@@ -153,11 +135,15 @@ public:
      buffer.  */
   enum register_status get_register_status (int regnum) const;
 
+  /* Collect register REGNUM from REGCACHE and store its contents in BUF.  */
   void raw_collect (int regnum, void *buf) const;
 
   void raw_collect_integer (int regnum, gdb_byte *addr, int addr_len,
                            bool is_signed) const;
 
+  void collect_regset (const struct regset *regset, int regnum,
+                      void *buf, size_t size) const;
+
   /* Supply register REGNUM, whose contents are stored in BUF, to REGCACHE.  */
   void raw_supply (int regnum, const void *buf);
 
@@ -171,8 +157,15 @@ public:
 
   void raw_supply_zeroed (int regnum);
 
+  void supply_regset (const struct regset *regset,
+                     int regnum, const void *buf, size_t size);
+
   void invalidate (int regnum);
 
+  /* Dump the contents of a register from the register cache to the target
+     debug.  */
+  void debug_print_register (const char *func, int regno);
+
   virtual ~reg_buffer () = 0;
 
 protected:
@@ -188,6 +181,11 @@ protected:
      zero iff the register's value can't be returned.  */
   void save (regcache_cooked_read_ftype *cooked_read, void *src);
 
+  void transfer_regset (const struct regset *regset,
+                       struct reg_buffer *out_regcache,
+                       int regnum, const void *in_buf,
+                       void *out_buf, size_t size) const;
+
   struct regcache_descr *m_descr;
 
   bool m_has_pseudo;
@@ -200,6 +198,23 @@ protected:
   friend class detached_regcache;
 };
 
+/* Transfer a set of registers (as described by REGSET) between
+   REGCACHE and BUF.  If REGNUM == -1, transfer all registers
+   belonging to the regset, otherwise just the register numbered
+   REGNUM.  The REGSET's 'regmap' field must point to an array of
+   'struct regcache_map_entry'.
+
+   These functions are suitable for the 'regset_supply' and
+   'regset_collect' fields in a regset structure.  */
+
+extern void regcache_supply_regset (const struct regset *regset,
+                                   reg_buffer *regcache,
+                                   int regnum, const void *buf,
+                                   size_t size);
+extern void regcache_collect_regset (const struct regset *regset,
+                                    const struct regcache *regcache,
+                                    int regnum, void *buf, size_t size);
+
 /* An abstract class which only has methods doing read.  */
 
 class readable_regcache : public reg_buffer
@@ -304,13 +319,6 @@ public:
   void cooked_write_part (int regnum, int offset, int len,
                          const gdb_byte *buf);
 
-  void supply_regset (const struct regset *regset,
-                     int regnum, const void *buf, size_t size);
-
-
-  void collect_regset (const struct regset *regset, int regnum,
-                      void *buf, size_t size) const;
-
   /* Return REGCACHE's ptid.  */
 
   ptid_t ptid () const
@@ -325,10 +333,6 @@ public:
     this->m_ptid = ptid;
   }
 
-/* Dump the contents of a register from the register cache to the target
-   debug.  */
-  void debug_print_register (const char *func, int regno);
-
   static void regcache_thread_ptid_changed (ptid_t old_ptid, ptid_t new_ptid);
 protected:
   regcache (gdbarch *gdbarch, const address_space *aspace_);
@@ -336,11 +340,6 @@ protected:
 
 private:
 
-  void transfer_regset (const struct regset *regset,
-                       struct regcache *out_regcache,
-                       int regnum, const void *in_buf,
-                       void *out_buf, size_t size) const;
-
   enum register_status write_part (int regnum, int offset, int len,
                                   const void *out, bool is_raw);
 
index 7a38f4085f4bbfaa7c7535790daca23f057b0555..b30a875ee3ad5336974195ab78b75c72e5f6164c 100644 (file)
@@ -25,7 +25,7 @@ struct regcache;
 
 /* Data structure describing a register set.  */
 
-typedef void (supply_regset_ftype) (const struct regset *, struct regcache *,
+typedef void (supply_regset_ftype) (const struct regset *, reg_buffer *,
                                     int, const void *, size_t);
 typedef void (collect_regset_ftype) (const struct regset *, 
                                      const struct regcache *,
index 3013fbe5e6ac676abafe7cc7b6247f1e99f0ffc3..0f1fa1d3dbb4514cba6d94553107aedf618e332e 100644 (file)
@@ -424,7 +424,7 @@ public:
   void resume (ptid_t, int, enum gdb_signal) override;
   ptid_t wait (ptid_t, struct target_waitstatus *, int) override;
 
-  void fetch_registers (struct regcache *, int) override;
+  void fetch_registers (ptid_t, reg_buffer *, int) override;
   void store_registers (struct regcache *, int) override;
   void prepare_to_store (struct regcache *) override;
 
@@ -839,11 +839,10 @@ public: /* Remote specific methods.  */
 
   void remote_notif_get_pending_events (notif_client *nc);
 
-  int fetch_register_using_p (struct regcache *regcache,
-                             packet_reg *reg);
+  int fetch_register_using_p (reg_buffer *regcache, packet_reg *reg);
   int send_g_packet ();
-  void process_g_packet (struct regcache *regcache);
-  void fetch_registers_using_g (struct regcache *regcache);
+  void process_g_packet (reg_buffer *regcache);
+  void fetch_registers_using_g (reg_buffer *regcache);
   int store_register_using_P (const struct regcache *regcache,
                              packet_reg *reg);
   void store_registers_using_G (const struct regcache *regcache);
@@ -8040,7 +8039,7 @@ remote_target::wait (ptid_t ptid, struct target_waitstatus *status, int options)
 /* Fetch a single register using a 'p' packet.  */
 
 int
-remote_target::fetch_register_using_p (struct regcache *regcache,
+remote_target::fetch_register_using_p (reg_buffer *regcache,
                                       packet_reg *reg)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -8138,7 +8137,7 @@ remote_target::send_g_packet ()
 }
 
 void
-remote_target::process_g_packet (struct regcache *regcache)
+remote_target::process_g_packet (reg_buffer *regcache)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   struct remote_state *rs = get_remote_state ();
@@ -8242,7 +8241,7 @@ remote_target::process_g_packet (struct regcache *regcache)
 }
 
 void
-remote_target::fetch_registers_using_g (struct regcache *regcache)
+remote_target::fetch_registers_using_g (reg_buffer *regcache)
 {
   send_g_packet ();
   process_g_packet (regcache);
@@ -8272,7 +8271,7 @@ remote_target::set_remote_traceframe ()
 }
 
 void
-remote_target::fetch_registers (struct regcache *regcache, int regnum)
+remote_target::fetch_registers (ptid_t ptid, reg_buffer *regcache, int regnum)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   struct remote_state *rs = get_remote_state ();
@@ -8280,7 +8279,7 @@ remote_target::fetch_registers (struct regcache *regcache, int regnum)
   int i;
 
   set_remote_traceframe ();
-  set_general_thread (regcache->ptid ());
+  set_general_thread (ptid);
 
   if (regnum >= 0)
     {
index 8e69c465fa742ce1bd2c99990bb874e763d3fc18..7b8d40fbf3fa92ec024effb09519305f8e56eba8 100644 (file)
@@ -100,7 +100,7 @@ static struct ppc_reg_offsets rs6000_aix64_reg_offsets =
 
 static void
 rs6000_aix_supply_regset (const struct regset *regset,
-                         struct regcache *regcache, int regnum,
+                         reg_buffer *regcache, int regnum,
                          const void *gregs, size_t len)
 {
   ppc_supply_gregset (regset, regcache, regnum, gregs, len);
index a0f290f61b8681564bc054c5be0e30b4c7e7f0e5..b2a0f31896eaacd4d2180347ae62fa85ad93da4c 100644 (file)
@@ -376,7 +376,7 @@ rs6000_register_sim_regno (struct gdbarch *gdbarch, int reg)
    Write the register to REGCACHE.  */
 
 void
-ppc_supply_reg (struct regcache *regcache, int regnum, 
+ppc_supply_reg (reg_buffer *regcache, int regnum,
                const gdb_byte *regs, size_t offset, int regsize)
 {
   if (regnum != -1 && offset != -1)
@@ -480,7 +480,7 @@ ppc_fpreg_offset (struct gdbarch_tdep *tdep,
    REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 void
-ppc_supply_gregset (const struct regset *regset, struct regcache *regcache,
+ppc_supply_gregset (const struct regset *regset, reg_buffer *regcache,
                    int regnum, const void *gregs, size_t len)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -530,7 +530,7 @@ ppc_supply_gregset (const struct regset *regset, struct regcache *regcache,
    REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 void
-ppc_supply_fpregset (const struct regset *regset, struct regcache *regcache,
+ppc_supply_fpregset (const struct regset *regset, reg_buffer *regcache,
                     int regnum, const void *fpregs, size_t len)
 {
   struct gdbarch *gdbarch = regcache->arch ();
index cd840c86d65a459afa380b04a1a20d0548222c28..d966ff26abbbaef12280e4d67fba91fdaaddd655 100644 (file)
@@ -183,15 +183,23 @@ static const struct regcache_map_entry s390_regmap_gsbc[] =
    the TDB registers unless the TDB format field is valid.  */
 
 static void
-s390_supply_tdb_regset (const struct regset *regset, struct regcache *regcache,
-                   int regnum, const void *regs, size_t len)
+s390_supply_tdb_regset (const struct regset *regset, reg_buffer *regcache,
+                       int regnum, const void *regs, size_t len)
 {
   ULONGEST tdw;
   enum register_status ret;
+  gdb_byte buf[register_size (regcache->arch (), S390_TDB_DWORD0_REGNUM)];
 
   regcache_supply_regset (regset, regcache, regnum, regs, len);
-  ret = regcache_cooked_read_unsigned (regcache, S390_TDB_DWORD0_REGNUM, &tdw);
-  if (ret != REG_VALID || (tdw >> 56) != 1)
+  if (regcache->get_register_status (S390_TDB_DWORD0_REGNUM) != REG_VALID)
+    {
+      regcache_supply_regset (regset, regcache, regnum, NULL, len);
+      return;
+    }
+
+  regcache->raw_collect (S390_TDB_DWORD0_REGNUM, buf);
+  tdw = extract_unsigned_integer(buf, register_size (regcache->arch (), S390_TDB_DWORD0_REGNUM), gdbarch_byte_order (regcache->arch ()));
+  if ((tdw >> 56) != 1)
     regcache_supply_regset (regset, regcache, regnum, NULL, len);
 }
 
index e4e08c706a1ca2277f259a5ec9da5bd7175f28aa..810b18cfa82d840c719489b708d0568d86f66740 100644 (file)
@@ -1050,7 +1050,7 @@ s390_register_call_saved (struct gdbarch *gdbarch, int regnum)
 
 static void
 s390_guess_tracepoint_registers (struct gdbarch *gdbarch,
-                                struct regcache *regcache,
+                                reg_buffer *regcache,
                                 CORE_ADDR addr)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
index 16bf00ea024e35d8fa9eb70bbb185fe3aa8f619b..871d7fed22d796c8e8745459443d4aeb78f8c8b5 100644 (file)
@@ -1418,7 +1418,7 @@ static const struct regcache_map_entry score7_linux_gregmap[] =
 
 static void
 score7_linux_supply_gregset(const struct regset *regset,
-                           struct regcache *regcache,
+                           reg_buffer *regcache,
                            int regnum, const void *buf,
                            size_t size)
 {
index d1a143414df9ce09d795251eff2cf8ba0d48e70a..be6b95457f3eea1f0d0c4d7ca19ee23978f968f9 100644 (file)
@@ -2161,7 +2161,7 @@ sh_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc)
 
 void
 sh_corefile_supply_regset (const struct regset *regset,
-                          struct regcache *regcache,
+                          reg_buffer *regcache,
                           int regnum, const void *regs, size_t len)
 {
   struct gdbarch *gdbarch = regcache->arch ();
index 00f4513489c751ed488500ab73ed8101fdd403f3..cc76abc905a30e055884a0c33492099f2b053568 100644 (file)
@@ -214,7 +214,7 @@ const struct sparc_gregmap sparc32_linux_core_gregmap =
 
 static void
 sparc32_linux_supply_core_gregset (const struct regset *regset,
-                                  struct regcache *regcache,
+                                  reg_buffer *regcache,
                                   int regnum, const void *gregs, size_t len)
 {
   sparc32_supply_gregset (&sparc32_linux_core_gregmap,
@@ -232,7 +232,7 @@ sparc32_linux_collect_core_gregset (const struct regset *regset,
 
 static void
 sparc32_linux_supply_core_fpregset (const struct regset *regset,
-                                   struct regcache *regcache,
+                                   reg_buffer *regcache,
                                    int regnum, const void *fpregs, size_t len)
 {
   sparc32_supply_fpregset (&sparc32_bsd_fpregmap, regcache, regnum, fpregs);
index a58c6e469fdf39a2d748fb5e7981270d8da20ca1..4dfd401b21e7c0f0dd64d44a4ba0913142b8b5e2 100644 (file)
@@ -52,7 +52,7 @@ const struct sparc_gregmap sparc32nbsd_gregmap =
 
 static void
 sparc32nbsd_supply_gregset (const struct regset *regset,
-                           struct regcache *regcache,
+                           reg_buffer *regcache,
                            int regnum, const void *gregs, size_t len)
 {
   sparc32_supply_gregset (&sparc32nbsd_gregmap, regcache, regnum, gregs);
@@ -67,7 +67,7 @@ sparc32nbsd_supply_gregset (const struct regset *regset,
 
 static void
 sparc32nbsd_supply_fpregset (const struct regset *regset,
-                            struct regcache *regcache,
+                            reg_buffer *regcache,
                             int regnum, const void *fpregs, size_t len)
 {
   sparc32_supply_fpregset (&sparc32_bsd_fpregmap, regcache, regnum, fpregs);
index 0f6caa632547e05f83f70cc4c61d4728cfdf5f28..ac5a00c017bd3e002ee637b2a1ff7b1ab0f0d6ee 100644 (file)
@@ -149,7 +149,7 @@ static const struct frame_unwind sparc32obsd_sigtramp_frame_unwind =
 #define SPARC32OBSD_UTHREAD_PC_OFFSET  132
 
 static void
-sparc32obsd_supply_uthread (struct regcache *regcache,
+sparc32obsd_supply_uthread (reg_buffer *regcache,
                            int regnum, CORE_ADDR addr)
 {
   struct gdbarch *gdbarch = regcache->arch ();
index 0b4d68a4a4236ab6f1a7381836bc4c0d539d28a8..70a7edfe5f51387df68c90a14c4a66be387b37fc 100644 (file)
@@ -25,7 +25,7 @@
 #include "ravenscar-thread.h"
 #include "sparc-ravenscar-thread.h"
 
-static void sparc_ravenscar_fetch_registers (struct regcache *regcache,
+static void sparc_ravenscar_fetch_registers (ptid_t ptid, reg_buffer *regcache,
                                              int regnum);
 static void sparc_ravenscar_store_registers (struct regcache *regcache,
                                              int regnum);
@@ -59,8 +59,8 @@ static const int sparc_register_offsets[] =
    regcache.  */
 
 static void
-supply_register_at_address (struct regcache *regcache, int regnum,
-                            CORE_ADDR register_addr)
+supply_register_at_address (reg_buffer *regcache, int regnum,
+                           CORE_ADDR register_addr)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   int buf_size = register_size (gdbarch, regnum);
@@ -101,7 +101,7 @@ register_in_thread_descriptor_p (int regnum)
    thread.  */
 
 static void
-sparc_ravenscar_fetch_registers (struct regcache *regcache, int regnum)
+sparc_ravenscar_fetch_registers (ptid_t ptid, reg_buffer *regcache, int regnum)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   const int sp_regnum = gdbarch_sp_regnum (gdbarch);
@@ -110,6 +110,7 @@ sparc_ravenscar_fetch_registers (struct regcache *regcache, int regnum)
   CORE_ADDR current_address;
   CORE_ADDR thread_descriptor_address;
   ULONGEST stack_address;
+  gdb_byte buf[register_size (gdbarch, sp_regnum)];
 
   /* The tid is the thread_id field, which is a pointer to the thread.  */
   thread_descriptor_address = (CORE_ADDR) ptid_get_tid (inferior_ptid);
@@ -118,7 +119,10 @@ sparc_ravenscar_fetch_registers (struct regcache *regcache, int regnum)
   current_address = thread_descriptor_address
     + sparc_register_offsets [sp_regnum];
   supply_register_at_address (regcache, sp_regnum, current_address);
-  regcache_cooked_read_unsigned (regcache, sp_regnum, &stack_address);
+  regcache->raw_collect (sp_regnum, buf);
+  stack_address
+    = extract_unsigned_integer (buf, register_size (gdbarch, sp_regnum),
+                               gdbarch_byte_order (gdbarch));
 
   /* Read registers.  */
   for (current_regnum = 0; current_regnum < num_regs; current_regnum ++)
index f3747466d2cbb34ce32fdcbd20d4ae4d6f2317ca..5659abcf007844481afaacf6cb4f3f12b93ab526 100644 (file)
@@ -54,7 +54,7 @@ const struct sparc_fpregmap sparc32_sol2_fpregmap =
 
 static void
 sparc32_sol2_supply_core_gregset (const struct regset *regset,
-                                 struct regcache *regcache,
+                                 reg_buffer *regcache,
                                  int regnum, const void *gregs, size_t len)
 {
   sparc32_supply_gregset (&sparc32_sol2_gregmap, regcache, regnum, gregs);
@@ -70,7 +70,7 @@ sparc32_sol2_collect_core_gregset (const struct regset *regset,
 
 static void
 sparc32_sol2_supply_core_fpregset (const struct regset *regset,
-                                  struct regcache *regcache,
+                                  reg_buffer *regcache,
                                   int regnum, const void *fpregs, size_t len)
 {
   sparc32_supply_fpregset (&sparc32_sol2_fpregmap, regcache, regnum, fpregs);
index 65c1f00620486bb8c7ce190f8381346cf311d9c6..8a61ad98f577baeef8812c0330e4780b0245b6fb 100644 (file)
@@ -1940,7 +1940,7 @@ sparc32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 /* Helper functions for dealing with register windows.  */
 
 void
-sparc_supply_rwindow (struct regcache *regcache, CORE_ADDR sp, int regnum)
+sparc_supply_rwindow (reg_buffer *regcache, CORE_ADDR sp, int regnum)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -2085,7 +2085,7 @@ sparc_collect_rwindow (const struct regcache *regcache,
 
 void
 sparc32_supply_gregset (const struct sparc_gregmap *gregmap,
-                       struct regcache *regcache,
+                       reg_buffer *regcache,
                        int regnum, const void *gregs)
 {
   const gdb_byte *regs = (const gdb_byte *) gregs;
@@ -2126,8 +2126,12 @@ sparc32_supply_gregset (const struct sparc_gregmap *gregmap,
       if (gregmap->r_l0_offset == -1)
        {
          ULONGEST sp;
+         struct gdbarch *gdbarch = regcache->arch ();
+         int sz = register_size (gdbarch, SPARC_SP_REGNUM);
+         gdb_byte buf[sz];
 
-         regcache_cooked_read_unsigned (regcache, SPARC_SP_REGNUM, &sp);
+         regcache->raw_collect (SPARC_SP_REGNUM, buf);
+         sp = extract_unsigned_integer (buf, sz, gdbarch_byte_order (gdbarch));
          sparc_supply_rwindow (regcache, sp, regnum);
        }
       else
index 4ca67d01b61085d5fc8ec95995410407c3238227..3f0d46e12c440cc6c021cfcb5865c3608bd46955 100644 (file)
@@ -214,7 +214,7 @@ extern int
 
 \f
 
-extern void sparc_supply_rwindow (struct regcache *regcache,
+extern void sparc_supply_rwindow (reg_buffer *regcache,
                                  CORE_ADDR sp, int regnum);
 extern void sparc_collect_rwindow (const struct regcache *regcache,
                                   CORE_ADDR sp, int regnum);
@@ -225,13 +225,13 @@ extern const struct sparc_fpregmap sparc32_sunos4_fpregmap;
 extern const struct sparc_fpregmap sparc32_bsd_fpregmap;
 
 extern void sparc32_supply_gregset (const struct sparc_gregmap *gregmap,
-                                   struct regcache *regcache,
+                                   reg_buffer *regcache,
                                    int regnum, const void *gregs);
 extern void sparc32_collect_gregset (const struct sparc_gregmap *gregmap,
                                     const struct regcache *regcache,
                                     int regnum, void *gregs);
 extern void sparc32_supply_fpregset (const struct sparc_fpregmap *fpregmap,
-                                    struct regcache *regcache,
+                                    reg_buffer *regcache,
                                     int regnum, const void *fpregs);
 extern void sparc32_collect_fpregset (const struct sparc_fpregmap *fpregmap,
                                      const struct regcache *regcache,
index 72b523d984c87ccc865feda551c28786261be1fa..0bb4f9c09879b1c597c931bd197fd378a902c840 100644 (file)
@@ -48,7 +48,7 @@ const struct sparc_gregmap sparc64fbsd_gregmap =
 
 static void
 sparc64fbsd_supply_gregset (const struct regset *regset,
-                           struct regcache *regcache,
+                           reg_buffer *regcache,
                            int regnum, const void *gregs, size_t len)
 {
   sparc64_supply_gregset (&sparc64fbsd_gregmap, regcache, regnum, gregs);
@@ -64,7 +64,7 @@ sparc64fbsd_collect_gregset (const struct regset *regset,
 
 static void
 sparc64fbsd_supply_fpregset (const struct regset *regset,
-                            struct regcache *regcache,
+                            reg_buffer *regcache,
                             int regnum, const void *fpregs, size_t len)
 {
   sparc64_supply_fpregset (&sparc64_bsd_fpregmap, regcache, regnum, fpregs);
index 8810c80f60f5ff70deb96c33283bc2ea1c96a8af..3978fa900e5c7d4969a27c46ed02b8dd59ae8bd4 100644 (file)
@@ -222,7 +222,7 @@ const struct sparc_gregmap sparc64_linux_core_gregmap =
 
 static void
 sparc64_linux_supply_core_gregset (const struct regset *regset,
-                                  struct regcache *regcache,
+                                  reg_buffer *regcache,
                                   int regnum, const void *gregs, size_t len)
 {
   sparc64_supply_gregset (&sparc64_linux_core_gregmap,
@@ -240,7 +240,7 @@ sparc64_linux_collect_core_gregset (const struct regset *regset,
 
 static void
 sparc64_linux_supply_core_fpregset (const struct regset *regset,
-                                   struct regcache *regcache,
+                                   reg_buffer *regcache,
                                    int regnum, const void *fpregs, size_t len)
 {
   sparc64_supply_fpregset (&sparc64_bsd_fpregmap, regcache, regnum, fpregs);
index cf26885e64a02301fb29a7f6f1ad80b7be4e5f08..a2f723d0a2dec814afdb17dc5b6d98eb3f85a69e 100644 (file)
@@ -50,7 +50,7 @@ const struct sparc_gregmap sparc64nbsd_gregmap =
 
 static void
 sparc64nbsd_supply_gregset (const struct regset *regset,
-                           struct regcache *regcache,
+                           reg_buffer *regcache,
                            int regnum, const void *gregs, size_t len)
 {
   sparc64_supply_gregset (&sparc64nbsd_gregmap, regcache, regnum, gregs);
@@ -58,7 +58,7 @@ sparc64nbsd_supply_gregset (const struct regset *regset,
 
 static void
 sparc64nbsd_supply_fpregset (const struct regset *regset,
-                            struct regcache *regcache,
+                            reg_buffer *regcache,
                             int regnum, const void *fpregs, size_t len)
 {
   sparc64_supply_fpregset (&sparc64_bsd_fpregmap, regcache, regnum, fpregs);
index 48b45c400cd99b633852fe64dbffb2f27a1ea6d1..7a1b4cc12deeef2361778c600cc54b9278aa66be 100644 (file)
@@ -72,7 +72,7 @@ const struct sparc_gregmap sparc64obsd_core_gregmap =
 
 static void
 sparc64obsd_supply_gregset (const struct regset *regset,
-                           struct regcache *regcache,
+                           reg_buffer *regcache,
                            int regnum, const void *gregs, size_t len)
 {
   const void *fpregs = (char *)gregs + 288;
@@ -89,7 +89,7 @@ sparc64obsd_supply_gregset (const struct regset *regset,
 
 static void
 sparc64obsd_supply_fpregset (const struct regset *regset,
-                            struct regcache *regcache,
+                            reg_buffer *regcache,
                             int regnum, const void *fpregs, size_t len)
 {
   sparc64_supply_fpregset (&sparc64_bsd_fpregmap, regcache, regnum, fpregs);
@@ -320,7 +320,7 @@ static const struct frame_unwind sparc64obsd_trapframe_unwind =
 #define SPARC64OBSD_UTHREAD_PC_OFFSET  240
 
 static void
-sparc64obsd_supply_uthread (struct regcache *regcache,
+sparc64obsd_supply_uthread (reg_buffer *regcache,
                            int regnum, CORE_ADDR addr)
 {
   struct gdbarch *gdbarch = regcache->arch ();
index 96a482d5077df8c067dc06afa4401bea600ec9e2..6768eeef166bbb10f7667d84672281073f280f8a 100644 (file)
@@ -53,7 +53,7 @@ const struct sparc_fpregmap sparc64_sol2_fpregmap =
 
 static void
 sparc64_sol2_supply_core_gregset (const struct regset *regset,
-                                 struct regcache *regcache,
+                                 reg_buffer *regcache,
                                  int regnum, const void *gregs, size_t len)
 {
   sparc64_supply_gregset (&sparc64_sol2_gregmap, regcache, regnum, gregs);
@@ -69,7 +69,7 @@ sparc64_sol2_collect_core_gregset (const struct regset *regset,
 
 static void
 sparc64_sol2_supply_core_fpregset (const struct regset *regset,
-                                  struct regcache *regcache,
+                                  reg_buffer *regcache,
                                   int regnum, const void *fpregs, size_t len)
 {
   sparc64_supply_fpregset (&sparc64_sol2_fpregmap, regcache, regnum, fpregs);
index 86b5fcf47bf9d2819bad3cc34be15037ed1a97ff..c108ee8bbb3623fb96819bc5e9090340294526a0 100644 (file)
@@ -1875,7 +1875,7 @@ sparc64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
 void
 sparc64_supply_gregset (const struct sparc_gregmap *gregmap,
-                       struct regcache *regcache,
+                       reg_buffer *regcache,
                        int regnum, const void *gregs)
 {
   struct gdbarch *gdbarch = regcache->arch ();
@@ -1969,8 +1969,12 @@ sparc64_supply_gregset (const struct sparc_gregmap *gregmap,
       if (gregmap->r_l0_offset == -1)
        {
          ULONGEST sp;
+         struct gdbarch *gdbarch = regcache->arch ();
+         int sz = register_size (gdbarch, SPARC_SP_REGNUM);
+         gdb_byte buf[sz];
 
-         regcache_cooked_read_unsigned (regcache, SPARC_SP_REGNUM, &sp);
+         regcache->raw_collect (SPARC_SP_REGNUM, buf);
+         sp = extract_unsigned_integer (buf, sz, gdbarch_byte_order (gdbarch));
          sparc_supply_rwindow (regcache, sp, regnum);
        }
       else
index 45442b3ac421fe01528542529950704ed28cb40f..e8752cf989c46c7ba13da81625650c22ef9d878c 100644 (file)
@@ -101,13 +101,13 @@ extern void sparc64_init_abi (struct gdbarch_info info,
                              struct gdbarch *gdbarch);
 
 extern void sparc64_supply_gregset (const struct sparc_gregmap *gregmap,
-                                   struct regcache *regcache,
+                                   reg_buffer *regcache,
                                    int regnum, const void *gregs);
 extern void sparc64_collect_gregset (const struct sparc_gregmap *gregmap,
                                     const struct regcache *regcache,
                                     int regnum, void *gregs);
 extern void sparc64_supply_fpregset (const struct sparc_fpregmap *fpregmap,
-                                    struct regcache *regcache,
+                                    reg_buffer *regcache,
                                     int regnum, const void *fpregs);
 extern void sparc64_collect_fpregset (const struct sparc_fpregmap *fpregmap,
                                      const struct regcache *regcache,
index 39a657ff1a97d9fad5e6b5f54e6ccf25fcb606af..3681b76587e12ac77c7fba10694abb5fb0b790c4 100644 (file)
@@ -52,7 +52,7 @@ struct spu_multiarch_target final : public target_ops
 
   void mourn_inferior () override;
 
-  void fetch_registers (struct regcache *, int) override;
+  void fetch_registers (ptid_t, reg_buffer *, int) override;
   void store_registers (struct regcache *, int) override;
 
   enum target_xfer_status xfer_partial (enum target_object object,
@@ -178,7 +178,7 @@ spu_multiarch_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
 /* Override the to_fetch_registers routine.  */
 
 void
-spu_multiarch_target::fetch_registers (struct regcache *regcache, int regno)
+spu_multiarch_target::fetch_registers (ptid_t ptid, reg_buffer *regcache, int regno)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
@@ -189,12 +189,12 @@ spu_multiarch_target::fetch_registers (struct regcache *regcache, int regno)
   /* Since we use functions that rely on inferior_ptid, we need to set and
      restore it.  */
   scoped_restore save_ptid
-    = make_scoped_restore (&inferior_ptid, regcache->ptid ());
+    = make_scoped_restore (&inferior_ptid, ptid);
 
   /* This version applies only if we're currently in spu_run.  */
   if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu)
     {
-      ops_beneath->fetch_registers (regcache, regno);
+      ops_beneath->fetch_registers (ptid, regcache, regno);
       return;
     }
 
index 5f3001b89f0e7c553881cd8cae01b4912efec222..fb2b1b4595218d56bff30da98351f01fcac0c4e4 100644 (file)
   target_debug_do_print (plongest (*(X)))
 #define target_debug_print_struct_regcache_p(X) \
   target_debug_do_print (host_address_to_string (X))
+#define target_debug_print_reg_buffer_p(X) \
+  target_debug_do_print (host_address_to_string (X))
 #define target_debug_print_struct_thread_info_p(X)     \
   target_debug_do_print (host_address_to_string (X))
 #define target_debug_print_struct_ui_file_p(X) \
index da7434712249b79dc84324cc6e0b2f2837517cd7..f76edaef0959a67dab71a65c398e24aa4786fc05 100644 (file)
@@ -16,7 +16,7 @@ struct dummy_target : public target_ops
   void resume (ptid_t arg0, int arg1, enum gdb_signal arg2) override;
   void commit_resume () override;
   ptid_t wait (ptid_t arg0, struct target_waitstatus *arg1, int arg2) override;
-  void fetch_registers (struct regcache *arg0, int arg1) override;
+  void fetch_registers (ptid_t arg0, reg_buffer *arg1, int arg2) override;
   void store_registers (struct regcache *arg0, int arg1) override;
   void prepare_to_store (struct regcache *arg0) override;
   void files_info () override;
@@ -184,7 +184,7 @@ struct debug_target : public target_ops
   void resume (ptid_t arg0, int arg1, enum gdb_signal arg2) override;
   void commit_resume () override;
   ptid_t wait (ptid_t arg0, struct target_waitstatus *arg1, int arg2) override;
-  void fetch_registers (struct regcache *arg0, int arg1) override;
+  void fetch_registers (ptid_t arg0, reg_buffer *arg1, int arg2) override;
   void store_registers (struct regcache *arg0, int arg1) override;
   void prepare_to_store (struct regcache *arg0) override;
   void files_info () override;
@@ -485,25 +485,27 @@ debug_target::wait (ptid_t arg0, struct target_waitstatus *arg1, int arg2)
 }
 
 void
-target_ops::fetch_registers (struct regcache *arg0, int arg1)
+target_ops::fetch_registers (ptid_t arg0, reg_buffer *arg1, int arg2)
 {
-  this->beneath->fetch_registers (arg0, arg1);
+  this->beneath->fetch_registers (arg0, arg1, arg2);
 }
 
 void
-dummy_target::fetch_registers (struct regcache *arg0, int arg1)
+dummy_target::fetch_registers (ptid_t arg0, reg_buffer *arg1, int arg2)
 {
 }
 
 void
-debug_target::fetch_registers (struct regcache *arg0, int arg1)
+debug_target::fetch_registers (ptid_t arg0, reg_buffer *arg1, int arg2)
 {
   fprintf_unfiltered (gdb_stdlog, "-> %s->fetch_registers (...)\n", this->beneath->shortname ());
-  this->beneath->fetch_registers (arg0, arg1);
+  this->beneath->fetch_registers (arg0, arg1, arg2);
   fprintf_unfiltered (gdb_stdlog, "<- %s->fetch_registers (", this->beneath->shortname ());
-  target_debug_print_struct_regcache_p (arg0);
+  target_debug_print_ptid_t (arg0);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_int (arg1);
+  target_debug_print_reg_buffer_p (arg1);
+  fputs_unfiltered (", ", gdb_stdlog);
+  target_debug_print_int (arg2);
   fputs_unfiltered (")\n", gdb_stdlog);
 }
 
index d96cdec418824a7cbbeb0589d1663b00a0c199a4..9dfb925e01c422733da025e3ce5716a3b82a30a8 100644 (file)
@@ -3516,9 +3516,9 @@ target_options_to_string (int target_options)
 }
 
 void
-target_fetch_registers (struct regcache *regcache, int regno)
+target_fetch_registers (ptid_t ptid, reg_buffer *regcache, int regno)
 {
-  target_stack->fetch_registers (regcache, regno);
+  target_stack->fetch_registers (ptid, regcache, regno);
   if (targetdebug)
     regcache->debug_print_register ("target_fetch_registers", regno);
 }
index e2d1e61cdcd70667c891997ca5aaec3dc82db3a7..d062113cf11dcc20a27d6d9a4a56f8cce2e83f59 100644 (file)
@@ -473,7 +473,7 @@ struct target_ops
     virtual ptid_t wait (ptid_t, struct target_waitstatus *,
                         int TARGET_DEBUG_PRINTER (target_debug_print_options))
       TARGET_DEFAULT_FUNC (default_target_wait);
-    virtual void fetch_registers (struct regcache *, int)
+    virtual void fetch_registers (ptid_t, reg_buffer *, int)
       TARGET_DEFAULT_IGNORE ();
     virtual void store_registers (struct regcache *, int)
       TARGET_DEFAULT_NORETURN (noprocess ());
@@ -1377,7 +1377,7 @@ extern ptid_t default_target_wait (struct target_ops *ops,
 
 /* Fetch at least register REGNO, or all regs if regno == -1.  No result.  */
 
-extern void target_fetch_registers (struct regcache *regcache, int regno);
+extern void target_fetch_registers (ptid_t ptid, reg_buffer *regcache, int regno);
 
 /* Store at least register REGNO, or all regs if REGNO == -1.
    It can store as many registers as it wants to, so target_prepare_to_store
index 2327d9e47e3a0e61d1519a51ae24e526d57cca23..8ad99b2073d346c47afb1cd058c4630397e2f336 100644 (file)
@@ -53,7 +53,7 @@ class tfile_target final : public tracefile_target
   { return tfile_target_info; }
 
   void close () override;
-  void fetch_registers (struct regcache *, int) override;
+  void fetch_registers (ptid_t ptid, reg_buffer *, int) override;
   enum target_xfer_status xfer_partial (enum target_object object,
                                                const char *annex,
                                                gdb_byte *readbuf,
@@ -868,7 +868,7 @@ traceframe_find_block_type (char type_wanted, int pos)
    requested register from it.  */
 
 void
-tfile_target::fetch_registers (struct regcache *regcache, int regno)
+tfile_target::fetch_registers (ptid_t ptid, reg_buffer *regcache, int regno)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   int offset, regn, regsize, dummy;
index ab34ecfdf99038088445d47bb8be301cc9c4e85e..e4f553c16b562b7beb264537878d7de2cc04ced5 100644 (file)
@@ -385,7 +385,7 @@ trace_save_ctf (const char *dirname, int target_does_save)
    ctf.  */
 
 void
-tracefile_fetch_registers (struct regcache *regcache, int regno)
+tracefile_fetch_registers (reg_buffer *regcache, int regno)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   struct tracepoint *tp = get_tracepoint (get_tracepoint_number ());
index 47f8bee8f276da9b3eab01cd1c9fc56184869507..c764b5d2d4d9945f0b84903923480d6b31e45e43 100644 (file)
@@ -129,6 +129,6 @@ public:
   bool thread_alive (ptid_t ptid) override;
 };
 
-extern void tracefile_fetch_registers (struct regcache *regcache, int regno);
+extern void tracefile_fetch_registers (reg_buffer *regcache, int regno);
 
 #endif /* TRACEFILE_H */
index d07a47790761abe66243744b6b4c90e01e6d82ad..e81f948be5bc1cde7988ae587979e949a746ccd7 100644 (file)
@@ -67,7 +67,7 @@ vax_register_type (struct gdbarch *gdbarch, int regnum)
    REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 static void
-vax_supply_gregset (const struct regset *regset, struct regcache *regcache,
+vax_supply_gregset (const struct regset *regset, reg_buffer *regcache,
                    int regnum, const void *gregs, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) gregs;
index 60e34c3075b233f6ffcef09959b33232e0256ecf..2078526b50cea215b3fddc709b86b402eea8912d 100644 (file)
@@ -836,7 +836,7 @@ xtensa_register_reggroup_p (struct gdbarch *gdbarch,
 
 static void
 xtensa_supply_gregset (const struct regset *regset,
-                      struct regcache *rc,
+                      reg_buffer *rc,
                       int regnum,
                       const void *gregs,
                       size_t len)