]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
regcache_raw and use it in to_{fetch,store}_registers users/qiyao/regcache-split-3
authorYao Qi <yao.qi@linaro.org>
Tue, 3 Oct 2017 14:23:48 +0000 (15:23 +0100)
committerYao Qi <yao.qi@linaro.org>
Fri, 13 Oct 2017 10:52:12 +0000 (11:52 +0100)
This patch adds a new class regcache_raw, between reg_buffer and regcache
in the class hierarchy.  Also use it in target_ops
to_{fetch,store}_registers methods, because target_ops accesses raw
registers.  (pseudo registers are abstracted by gdbarch).

gdb:

2017-10-03  Yao Qi  <yao.qi@linaro.org>
:
* aarch32-linux-nat.c (aarch32_gp_regcache_supply): -
(aarch32_gp_regcache_supply): +
(aarch32_gp_regcache_supply):
(aarch32_gp_regcache_collect): -
(aarch32_gp_regcache_collect): +
(aarch32_gp_regcache_collect):
(aarch32_vfp_regcache_supply): -
(aarch32_vfp_regcache_supply): +
(aarch32_vfp_regcache_supply):
(aarch32_vfp_regcache_collect): -
(aarch32_vfp_regcache_collect): +
* aarch32-linux-nat.h:
* aarch64-linux-nat.c (aarch64_get_debug_reg_state):
(fetch_gregs_from_thread): -
(fetch_gregs_from_thread): +
(fetch_gregs_from_thread):
(store_gregs_to_thread): -
(store_gregs_to_thread): +
(store_gregs_to_thread):
(fetch_fpregs_from_thread): -
(fetch_fpregs_from_thread): +
(fetch_fpregs_from_thread):
(store_fpregs_to_thread): -
(store_fpregs_to_thread): +
(store_fpregs_to_thread):
(aarch64_linux_fetch_inferior_registers):
* arch-utils.c (default_addressable_memory_unit_size):
* arch-utils.h (extern const char *default_gnu_triplet_regexp):
* arm-linux-tdep.c (static struct tramp_frame arm_kernel_linux_restart_syscall_tramp_frame = {):
(arm_linux_supply_gregset):
(arm_linux_collect_gregset):
(supply_nwfpe_register): -
(supply_nwfpe_register): +
(supply_nwfpe_register):
(collect_nwfpe_register): -
(collect_nwfpe_register): +
(collect_nwfpe_register):
(arm_linux_supply_nwfpe):
(arm_linux_collect_nwfpe):
(arm_linux_supply_vfp):
* arm-linux-tdep.h (void arm_linux_collect_gregset):
* corelow.c (core_detach):
(get_core_register_section): -
(get_core_register_section): +
(get_core_registers_cb):
* gdbarch.c (set_gdbarch_fast_tracepoint_valid_at):
(gdbarch_guess_tracepoint_registers): -
(gdbarch_guess_tracepoint_registers): +
* gdbarch.h (extern void set_gdbarch_fast_tracepoint_valid_at):
* gdbarch.sh (m;int;fast_tracepoint_valid_at;CORE_ADDR addr, char **msg;addr, msg;;default_fas):
* gdbcore.h (struct core_fns):
* inf-child.c (store_waitstatus):
(inf_child_fetch_inferior_registers):
(inf_child_post_attach):
* inf-ptrace.c (static CORE_ADDR):
(inf_ptrace_fetch_register): -
(inf_ptrace_fetch_register): +
(inf_ptrace_fetch_register):
(inf_ptrace_fetch_registers):
(inf_ptrace_store_register): -
(inf_ptrace_store_register): +
(inf_ptrace_store_register):
* record-btrace.c (record_btrace_remove_breakpoint):
(record_btrace_fetch_registers):
(record_btrace_store_registers):
* record-full.c (static void record_full_save):
(record_full_reg_alloc): -
(record_full_reg_alloc): +
(record_full_get_loc):
(record_full_arch_list_add_reg): -
(record_full_arch_list_add_reg): +
(record_full_supports_stopped_by_hw_breakpoint):
(record_full_registers_change): -
(record_full_registers_change): +
(record_full_registers_change):
(record_full_core_kill):
(record_full_core_fetch_registers):
(record_full_core_prepare_to_store):
* record-full.h:
* regcache.c (regcache_register_size):
(regcache::regcache):
(regcache::arch):
(regcache_get_ptid): -
(regcache_get_ptid): +
(class regcache_invalidator):
(public:):
(public:):
(get_regcache_arch): -
(get_regcache_arch): +
(regcache_dup):
(regcache_register_status): -
(regcache_register_status): +
(reg_buffer::set_register_status):
(regcache_invalidate): -
(regcache_invalidate): +
(registers_changed):
(regcache_raw_update): -
(regcache_raw_update): +
(regcache_raw_update):
(regcache::raw_update):
(regcache_raw_read): -
(regcache_raw_read): +
(regcache_raw_read_signed):
(regcache_raw_write_signed):
(regcache_raw_write):
(reg_buffer::raw_supply_zeroed):
(regcache_raw_collect): -
(regcache_raw_collect): +
(reg_buffer::transfer_regset):
(reg_buffer::supply_regset):
(regcache_write_pc):
* regcache.h (struct regcache;):
(extern struct regcache *get_thread_arch_aspace_regcache):
(extern enum register_status):
(extern void regcache_write_pc):
(enum):
(private:):
(public:):
(public:):
(public:):
(public:):
(private:):
* regset.h (struct regcache;):
* remote.c (static int getpkt_or_notif_sane):
(remote_wait):
(fetch_register_using_p): -
(fetch_register_using_p): +
(send_g_packet):
(process_g_packet): -
(process_g_packet): +
(process_g_packet):
(fetch_registers_using_g): -
(fetch_registers_using_g): +
(set_remote_traceframe):
(remote_fetch_registers):
(remote_prepare_to_store): -
(remote_prepare_to_store): +
(remote_prepare_to_store):
(store_register_using_P): -
(store_register_using_P): +
(store_register_using_P):
(store_registers_using_G): -
(store_registers_using_G): +
(store_registers_using_G):
* s390-linux-tdep.c (s390_write_pc):
* target-debug.h:
* target-delegates.c (debug_wait):
(delegate_fetch_registers): -
(delegate_fetch_registers): +
(tdefault_fetch_registers): -
(tdefault_fetch_registers): +
(debug_fetch_registers): -
(debug_fetch_registers): +
(delegate_store_registers): -
(delegate_store_registers): +
(tdefault_store_registers): -
(tdefault_store_registers): +
(debug_store_registers): -
(debug_store_registers): +
(delegate_prepare_to_store): -
(delegate_prepare_to_store): +
(tdefault_prepare_to_store): -
(tdefault_prepare_to_store): +
(debug_prepare_to_store): -
(debug_prepare_to_store): +
* target.c (target_options_to_string):
(target_fetch_registers): -
(target_fetch_registers): +
(target_fetch_registers):
(target_store_registers): -
(target_store_registers): +
* target.h (struct target_ops):
(extern ptid_t default_target_wait):
* tracefile-tfile.c (traceframe_find_block_type):
* tracefile.c (trace_save_ctf):
(tracefile_fetch_registers): -
(tracefile_fetch_registers): +
* tracefile.h (extern struct trace_file_writer *tfile_trace_file_writer_new):

30 files changed:
gdb/aarch32-linux-nat.c
gdb/aarch32-linux-nat.h
gdb/aarch64-linux-nat.c
gdb/arch-utils.c
gdb/arch-utils.h
gdb/arm-linux-tdep.c
gdb/arm-linux-tdep.h
gdb/corelow.c
gdb/gdbarch-selftests.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/gdbcore.h
gdb/inf-child.c
gdb/inf-ptrace.c
gdb/record-btrace.c
gdb/record-full.c
gdb/record-full.h
gdb/regcache.c
gdb/regcache.h
gdb/regset.h
gdb/remote.c
gdb/s390-linux-tdep.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

index 94e348fefffd937ad2b8a00ccdbf14b8dce4e203..a7a3b858158d6fb6e1e568ba8f5d61722cfa4f30 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 (regcache_raw *regcache, uint32_t *regs,
                            int arm_apcs_32)
 {
   int regno;
@@ -54,7 +54,7 @@ aarch32_gp_regcache_supply (struct regcache *regcache, uint32_t *regs,
    true if the 32-bit mode is in use, otherwise, it is false.  */
 
 void
-aarch32_gp_regcache_collect (const struct regcache *regcache, uint32_t *regs,
+aarch32_gp_regcache_collect (const regcache_raw *regcache, uint32_t *regs,
                             int arm_apcs_32)
 {
   int regno;
@@ -82,7 +82,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 (regcache_raw *regcache, gdb_byte *regs,
                             const int vfp_register_count)
 {
   int regno;
@@ -99,7 +99,7 @@ aarch32_vfp_regcache_supply (struct regcache *regcache, gdb_byte *regs,
    VFP_REGISTER_COUNT is the number VFP registers.  */
 
 void
-aarch32_vfp_regcache_collect (const struct regcache *regcache, gdb_byte *regs,
+aarch32_vfp_regcache_collect (const regcache_raw *regcache, gdb_byte *regs,
                              const int vfp_register_count)
 {
   int regno;
index 369fe30fdb676c3f8a08ac9ed0e98e98363119cc..d6720e4c8b11dba2f53d6a8cdab390f994092761 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 (regcache_raw *regcache, uint32_t *regs,
                                 int arm_apcs_32);
 
-void aarch32_gp_regcache_collect (const struct regcache *regcache,
+void aarch32_gp_regcache_collect (const regcache_raw *regcache,
                                  uint32_t *regs, int arm_apcs_32);
 
-void aarch32_vfp_regcache_supply (struct regcache *regcache, gdb_byte *regs,
+void aarch32_vfp_regcache_supply (regcache_raw *regcache, gdb_byte *regs,
                                  const int vfp_register_count);
 
-void aarch32_vfp_regcache_collect (const struct regcache *regcache,
+void aarch32_vfp_regcache_collect (const regcache_raw *regcache,
                                   gdb_byte *regs,
                                   const int vfp_register_count);
index 2ddf85f6704ac7e9c4614456cab17911548f52c4..b98f30a4297032af35c318e855741920539bbeb5 100644 (file)
@@ -152,7 +152,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 (regcache_raw *regcache)
 {
   int ret, tid;
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
@@ -190,7 +190,7 @@ fetch_gregs_from_thread (struct regcache *regcache)
    values in the GDB's register array.  */
 
 static void
-store_gregs_to_thread (const struct regcache *regcache)
+store_gregs_to_thread (const regcache_raw *regcache)
 {
   int ret, tid;
   elf_gregset_t regs;
@@ -233,7 +233,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 (regcache_raw *regcache)
 {
   int ret, tid;
   elf_fpregset_t regs;
@@ -281,7 +281,7 @@ fetch_fpregs_from_thread (struct regcache *regcache)
    values in the GDB's register array.  */
 
 static void
-store_fpregs_to_thread (const struct regcache *regcache)
+store_fpregs_to_thread (const regcache_raw *regcache)
 {
   int ret, tid;
   elf_fpregset_t regs;
@@ -346,7 +346,7 @@ store_fpregs_to_thread (const struct regcache *regcache)
 
 static void
 aarch64_linux_fetch_inferior_registers (struct target_ops *ops,
-                                       struct regcache *regcache,
+                                       regcache_raw *regcache,
                                        int regno)
 {
   if (regno == -1)
@@ -364,7 +364,7 @@ aarch64_linux_fetch_inferior_registers (struct target_ops *ops,
 
 static void
 aarch64_linux_store_inferior_registers (struct target_ops *ops,
-                                       struct regcache *regcache,
+                                       regcache_raw *regcache,
                                        int regno)
 {
   if (regno == -1)
index 02ffd6b574f5fb1c7a80af77ceca0a8ea02b34c1..edc2e1c358f2b5d2cc26169b11e10cd3a139dafa 100644 (file)
@@ -945,7 +945,7 @@ default_addressable_memory_unit_size (struct gdbarch *gdbarch)
 
 void
 default_guess_tracepoint_registers (struct gdbarch *gdbarch,
-                                   struct regcache *regcache,
+                                   regcache_raw *regcache,
                                    CORE_ADDR addr)
 {
   int pc_regno = gdbarch_pc_regnum (gdbarch);
index fa2908605f5b3956e5c1ebdc619f69c06a0f061b..74bc701ad22310c9307c0314b8f614d0c949c60b 100644 (file)
@@ -263,7 +263,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,
+                                               regcache_raw *regcache,
                                                CORE_ADDR addr);
 
 extern int default_print_insn (bfd_vma memaddr, disassemble_info *info);
index 056c1b94212c7d0f7e7a8ca29130155b0d2409f1..4462210304b5e6e1e984be53b1e052c192d088d2 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,
+                         regcache_raw *regcache,
                          int regnum, const void *gregs_buf, size_t len)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
@@ -513,7 +513,7 @@ arm_linux_supply_gregset (const struct regset *regset,
 
 void
 arm_linux_collect_gregset (const struct regset *regset,
-                          const struct regcache *regcache,
+                          const regcache_raw *regcache,
                           int regnum, void *gregs_buf, size_t len)
 {
   gdb_byte *gregs = (gdb_byte *) gregs_buf;
@@ -547,7 +547,7 @@ arm_linux_collect_gregset (const struct regset *regset,
 #define typeExtended           0x03
 
 void
-supply_nwfpe_register (struct regcache *regcache, int regno,
+supply_nwfpe_register (regcache_raw *regcache, int regno,
                       const gdb_byte *regs)
 {
   const gdb_byte *reg_data;
@@ -582,7 +582,7 @@ supply_nwfpe_register (struct regcache *regcache, int regno,
 }
 
 void
-collect_nwfpe_register (const struct regcache *regcache, int regno,
+collect_nwfpe_register (const regcache_raw *regcache, int regno,
                        gdb_byte *regs)
 {
   gdb_byte *reg_data;
@@ -620,7 +620,7 @@ collect_nwfpe_register (const struct regcache *regcache, int regno,
 
 void
 arm_linux_supply_nwfpe (const struct regset *regset,
-                       struct regcache *regcache,
+                       regcache_raw *regcache,
                        int regnum, const void *regs_buf, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) regs_buf;
@@ -637,7 +637,7 @@ arm_linux_supply_nwfpe (const struct regset *regset,
 
 void
 arm_linux_collect_nwfpe (const struct regset *regset,
-                        const struct regcache *regcache,
+                        const regcache_raw *regcache,
                         int regnum, void *regs_buf, size_t len)
 {
   gdb_byte *regs = (gdb_byte *) regs_buf;
@@ -658,7 +658,7 @@ arm_linux_collect_nwfpe (const struct regset *regset,
 
 static void
 arm_linux_supply_vfp (const struct regset *regset,
-                     struct regcache *regcache,
+                     regcache_raw *regcache,
                      int regnum, const void *regs_buf, size_t len)
 {
   const gdb_byte *regs = (const gdb_byte *) regs_buf;
@@ -675,7 +675,7 @@ arm_linux_supply_vfp (const struct regset *regset,
 
 static void
 arm_linux_collect_vfp (const struct regset *regset,
-                        const struct regcache *regcache,
+                      const regcache_raw *regcache,
                         int regnum, void *regs_buf, size_t len)
 {
   gdb_byte *regs = (gdb_byte *) regs_buf;
index 263445567035d69091c74d0d5370624f8a0108b4..a5be461e812a7d056027754b4e7960cb0129904f 100644 (file)
@@ -44,9 +44,9 @@ 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 (regcache_raw *regcache, int regno,
                            const gdb_byte *regs);
-void collect_nwfpe_register (const struct regcache *regcache, int regno,
+void collect_nwfpe_register (const regcache_raw *regcache, int regno,
                             gdb_byte *regs);
 
 void arm_linux_supply_nwfpe (const struct regset *regset,
index 594db1d6f287b16ca16122d168d956dc768dd0a3..5483a78be5a7b9df1d19f2b3e57dcbf66541f127 100644 (file)
@@ -493,7 +493,7 @@ core_detach (struct target_ops *ops, const char *args, int from_tty)
    nothing.  */
 
 static void
-get_core_register_section (struct regcache *regcache,
+get_core_register_section (regcache_raw *regcache,
                           const struct regset *regset,
                           const char *name,
                           int min_size,
@@ -590,7 +590,7 @@ get_core_registers_cb (const char *sect_name, int size,
 
 static void
 get_core_registers (struct target_ops *ops,
-                   struct regcache *regcache, int regno)
+                   regcache_raw *regcache, int regno)
 {
   int i;
   struct gdbarch *gdbarch;
index 58ed11287a0c3bef9e5a678f89d6d301fc4d4431..f9629e85f8ffc499266ce0811c9102ae0bc864fd 100644 (file)
@@ -49,12 +49,12 @@ test_target_has_memory (target_ops *self)
 }
 
 static void
-test_target_prepare_to_store (target_ops *self, regcache *regs)
+test_target_prepare_to_store (target_ops *self, regcache_raw *regs)
 {
 }
 
 static void
-test_target_store_registers (target_ops *self, regcache *regs, int regno)
+test_target_store_registers (target_ops *self, regcache_raw *regs, int regno)
 {
 }
 
index 5a84879ae1e58f99d3f44eed8fc6ab5487471893..325848090c5ec921b7c5d1388707afd1b5a0fc79 100644 (file)
@@ -4677,7 +4677,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, regcache_raw *regcache, CORE_ADDR addr)
 {
   gdb_assert (gdbarch != NULL);
   gdb_assert (gdbarch->guess_tracepoint_registers != NULL);
index 830acb28b4a9a1253d401cfaa71d2b683e937984..b672a3882f84364e0167804e78550d24f07e159f 100644 (file)
@@ -1384,8 +1384,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, regcache_raw *regcache, CORE_ADDR addr);
+extern void gdbarch_guess_tracepoint_registers (struct gdbarch *gdbarch, regcache_raw *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 addd92df0a57b2ac3c669c5d6b61dee2e8ecd9cc..ed3fc53b5bf70ddb9def97e7f5eab5912416fdae 100755 (executable)
@@ -1056,7 +1056,7 @@ m;int;fast_tracepoint_valid_at;CORE_ADDR addr, char **msg;addr, msg;;default_fas
 # 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;regcache_raw *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 5c86e98691828b6674ccec078c4d7790c3ec2948..c01e7d9e3a0cf03eba9f164ba04c47ca130de13c 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) (regcache_raw *regcache,
                                 char *core_reg_sect,
                                 unsigned core_reg_size,
                                 int which, CORE_ADDR reg_addr);
index b04b52e9b0ad2b4ba86464f2fbcbb7b426d99ef8..42de10098fea38a5381f94bf31150d6d7aff88c7 100644 (file)
@@ -72,7 +72,7 @@ store_waitstatus (struct target_waitstatus *ourstatus, int hoststatus)
 
 static void
 inf_child_fetch_inferior_registers (struct target_ops *ops,
-                                   struct regcache *regcache, int regnum)
+                                   regcache_raw *regcache, int regnum)
 {
   if (regnum == -1)
     {
@@ -90,7 +90,7 @@ inf_child_fetch_inferior_registers (struct target_ops *ops,
 
 static void
 inf_child_store_inferior_registers (struct target_ops *ops,
-                                   struct regcache *regcache, int regnum)
+                                   regcache_raw *regcache, int regnum)
 {
 }
 
@@ -109,7 +109,7 @@ inf_child_post_attach (struct target_ops *self, int pid)
 
 static void
 inf_child_prepare_to_store (struct target_ops *self,
-                           struct regcache *regcache)
+                           regcache_raw *regcache)
 {
 }
 
index af181f084cb72a0ac5c29199dccff34814a787b6..9deb48d621427100520465d23b57a3aeae00746b 100644 (file)
@@ -711,9 +711,9 @@ static CORE_ADDR (*inf_ptrace_register_u_offset)(struct gdbarch *, int, int);
 /* Fetch register REGNUM from the inferior.  */
 
 static void
-inf_ptrace_fetch_register (struct regcache *regcache, int regnum)
+inf_ptrace_fetch_register (regcache_raw *regcache, int regnum)
 {
-  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch *gdbarch = regcache->arch ();
   CORE_ADDR addr;
   size_t size;
   PTRACE_TYPE_RET *buf;
@@ -755,11 +755,11 @@ inf_ptrace_fetch_register (struct regcache *regcache, int regnum)
 
 static void
 inf_ptrace_fetch_registers (struct target_ops *ops,
-                           struct regcache *regcache, int regnum)
+                           regcache_raw *regcache, int regnum)
 {
   if (regnum == -1)
     for (regnum = 0;
-        regnum < gdbarch_num_regs (get_regcache_arch (regcache));
+        regnum < gdbarch_num_regs (regcache->arch ());
         regnum++)
       inf_ptrace_fetch_register (regcache, regnum);
   else
@@ -769,7 +769,7 @@ inf_ptrace_fetch_registers (struct target_ops *ops,
 /* Store register REGNUM into the inferior.  */
 
 static void
-inf_ptrace_store_register (const struct regcache *regcache, int regnum)
+inf_ptrace_store_register (const regcache_raw *regcache, int regnum)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
   CORE_ADDR addr;
@@ -810,7 +810,7 @@ inf_ptrace_store_register (const struct regcache *regcache, int regnum)
 
 static void
 inf_ptrace_store_registers (struct target_ops *ops,
-                           struct regcache *regcache, int regnum)
+                           regcache_raw *regcache, int regnum)
 {
   if (regnum == -1)
     for (regnum = 0;
index 77844bc52a52ca2997d4610774fda53d38c402bf..7ad085031280e033db376fb40b030091b4a332a5 100644 (file)
@@ -1408,7 +1408,7 @@ record_btrace_remove_breakpoint (struct target_ops *ops,
 
 static void
 record_btrace_fetch_registers (struct target_ops *ops,
-                              struct regcache *regcache, int regno)
+                              regcache_raw *regcache, int regno)
 {
   struct btrace_insn_iterator *replay;
   struct thread_info *tp;
@@ -1449,7 +1449,7 @@ record_btrace_fetch_registers (struct target_ops *ops,
 
 static void
 record_btrace_store_registers (struct target_ops *ops,
-                              struct regcache *regcache, int regno)
+                              regcache_raw *regcache, int regno)
 {
   struct target_ops *t;
 
@@ -1467,7 +1467,7 @@ record_btrace_store_registers (struct target_ops *ops,
 
 static void
 record_btrace_prepare_to_store (struct target_ops *ops,
-                               struct regcache *regcache)
+                               regcache_raw *regcache)
 {
   struct target_ops *t;
 
index 7f8849b96b51b20d96eb18efcd97c5a14ddd12b3..57da46aeb5b1393a7eacbfe71d7c3d647a136b64 100644 (file)
@@ -241,7 +241,7 @@ static void record_full_save (struct target_ops *self,
 /* Alloc a record_full_reg record entry.  */
 
 static inline struct record_full_entry *
-record_full_reg_alloc (struct regcache *regcache, int regnum)
+record_full_reg_alloc (regcache_raw *regcache, int regnum)
 {
   struct record_full_entry *rec;
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
@@ -465,7 +465,7 @@ record_full_get_loc (struct record_full_entry *rec)
 /* Record the value of a register NUM to record_full_arch_list.  */
 
 int
-record_full_arch_list_add_reg (struct regcache *regcache, int regnum)
+record_full_arch_list_add_reg (regcache_raw *regcache, int regnum)
 {
   struct record_full_entry *rec;
 
@@ -1393,7 +1393,7 @@ record_full_supports_stopped_by_hw_breakpoint (struct target_ops *ops)
 /* Record registers change (by user or by GDB) to list as an instruction.  */
 
 static void
-record_full_registers_change (struct regcache *regcache, int regnum)
+record_full_registers_change (regcache_raw *regcache, int regnum)
 {
   /* Check record_full_insn_num.  */
   record_full_check_insn_num ();
@@ -1441,7 +1441,7 @@ record_full_registers_change (struct regcache *regcache, int regnum)
 
 static void
 record_full_store_registers (struct target_ops *ops,
-                            struct regcache *regcache,
+                            regcache_raw *regcache,
                             int regno)
 {
   if (!record_full_gdb_operation_disable)
@@ -2024,7 +2024,7 @@ record_full_core_kill (struct target_ops *ops)
 
 static void
 record_full_core_fetch_registers (struct target_ops *ops,
-                                 struct regcache *regcache,
+                                 regcache_raw *regcache,
                                  int regno)
 {
   if (regno < 0)
@@ -2045,7 +2045,7 @@ record_full_core_fetch_registers (struct target_ops *ops,
 
 static void
 record_full_core_prepare_to_store (struct target_ops *self,
-                                  struct regcache *regcache)
+                                  regcache_raw *regcache)
 {
 }
 
@@ -2053,8 +2053,8 @@ record_full_core_prepare_to_store (struct target_ops *self,
 
 static void
 record_full_core_store_registers (struct target_ops *ops,
-                             struct regcache *regcache,
-                             int regno)
+                                 regcache_raw *regcache,
+                                 int regno)
 {
   if (record_full_gdb_operation_disable)
     record_full_core_regbuf->raw_supply (regno,
index 728bf59958bf87dc55fe2e0cc3c424a53fe4fa7d..6bd6e1911a02f8dc85fe43006209e188d682ffa6 100644 (file)
@@ -22,7 +22,7 @@
 
 extern int record_full_memory_query;
 
-extern int record_full_arch_list_add_reg (struct regcache *regcache, int num);
+extern int record_full_arch_list_add_reg (regcache_raw *regcache, int num);
 extern int record_full_arch_list_add_mem (CORE_ADDR addr, int len);
 extern int record_full_arch_list_add_end (void);
 
index ebc9e69c5ba237d9fbe77af9613af0a511ac08f2..197d1c2c7372901cf080b1a7d440e7b7d93d60ce 100644 (file)
@@ -232,17 +232,20 @@ regcache_register_size (const struct regcache *regcache, int n)
   return register_size (get_regcache_arch (regcache), n);
 }
 
-regcache::regcache (gdbarch *gdbarch, address_space *aspace_,
-                   bool readonly_p_)
+regcache_raw::regcache_raw (gdbarch *gdbarch, bool readonly_p_)
   /* The register buffers.  A read-only register cache can hold the
      full [0 .. gdbarch_num_regs + gdbarch_num_pseudo_regs) while a
      read/write register cache can only hold [0 .. gdbarch_num_regs).  */
-  : reg_buffer (gdbarch, readonly_p_),
-    m_aspace (aspace_), m_readonly_p (readonly_p_)
+  : reg_buffer (gdbarch, readonly_p_), m_readonly_p (readonly_p_)
 {
   m_ptid = minus_one_ptid;
 }
 
+regcache::regcache (gdbarch *gdbarch, address_space *aspace_,
+                   bool readonly_p_)
+  : regcache_raw (gdbarch, readonly_p_), m_aspace (aspace_)
+{}
+
 static enum register_status
 do_cooked_read (void *src, int regnum, gdb_byte *buf)
 {
@@ -259,7 +262,7 @@ regcache::regcache (readonly_t, const regcache &src)
 }
 
 gdbarch *
-regcache::arch () const
+regcache_raw::arch () const
 {
   return m_descr->gdbarch;
 }
@@ -267,7 +270,7 @@ regcache::arch () const
 /* See regcache.h.  */
 
 ptid_t
-regcache_get_ptid (const struct regcache *regcache)
+regcache_get_ptid (const regcache_raw *regcache)
 {
   gdb_assert (!ptid_equal (regcache->ptid (), minus_one_ptid));
 
@@ -280,7 +283,7 @@ class regcache_invalidator
 {
 public:
 
-  regcache_invalidator (struct regcache *regcache, int regnum)
+  regcache_invalidator (regcache_raw *regcache, int regnum)
     : m_regcache (regcache),
       m_regnum (regnum)
   {
@@ -289,7 +292,7 @@ public:
   ~regcache_invalidator ()
   {
     if (m_regcache != nullptr)
-      regcache_invalidate (m_regcache, m_regnum);
+      m_regcache->invalidate (m_regnum);
   }
 
   DISABLE_COPY_AND_ASSIGN (regcache_invalidator);
@@ -301,14 +304,14 @@ public:
 
 private:
 
-  struct regcache *m_regcache;
+  regcache_raw *m_regcache;
   int m_regnum;
 };
 
 /* Return REGCACHE's architecture.  */
 
 struct gdbarch *
-get_regcache_arch (const struct regcache *regcache)
+get_regcache_arch (const regcache_raw *regcache)
 {
   return regcache->arch ();
 }
@@ -411,7 +414,7 @@ regcache_dup (struct regcache *src)
 }
 
 enum register_status
-regcache_register_status (const struct regcache *regcache, int regnum)
+regcache_register_status (const reg_buffer *regcache, int regnum)
 {
   gdb_assert (regcache != NULL);
   return regcache->get_register_status (regnum);
@@ -432,14 +435,14 @@ reg_buffer::set_register_status (int regnum, enum register_status status)
 }
 
 void
-regcache_invalidate (struct regcache *regcache, int regnum)
+regcache_invalidate (regcache_raw *regcache, int regnum)
 {
   gdb_assert (regcache != NULL);
   regcache->invalidate (regnum);
 }
 
 void
-regcache::invalidate (int regnum)
+regcache_raw::invalidate (int regnum)
 {
   gdb_assert (regnum >= 0);
   gdb_assert (!m_readonly_p);
@@ -584,7 +587,7 @@ registers_changed (void)
 }
 
 void
-regcache_raw_update (struct regcache *regcache, int regnum)
+regcache_raw_update (regcache_raw *regcache, int regnum)
 {
   gdb_assert (regcache != NULL);
 
@@ -592,7 +595,7 @@ regcache_raw_update (struct regcache *regcache, int regnum)
 }
 
 void
-regcache::raw_update (int regnum)
+regcache_raw::raw_update (int regnum)
 {
   gdb_assert (regnum >= 0 && regnum < m_descr->nr_raw_registers);
 
@@ -614,13 +617,13 @@ regcache::raw_update (int regnum)
 }
 
 enum register_status
-regcache_raw_read (struct regcache *regcache, int regnum, gdb_byte *buf)
+regcache_raw_read (regcache_raw *regcache, int regnum, gdb_byte *buf)
 {
   return regcache->raw_read (regnum, buf);
 }
 
 enum register_status
-regcache::raw_read (int regnum, gdb_byte *buf)
+regcache_raw::raw_read (int regnum, gdb_byte *buf)
 {
   gdb_assert (buf != NULL);
   raw_update (regnum);
@@ -643,7 +646,7 @@ regcache_raw_read_signed (struct regcache *regcache, int regnum, LONGEST *val)
 
 template<typename T, typename>
 enum register_status
-regcache::raw_read (int regnum, T *val)
+regcache_raw::raw_read (int regnum, T *val)
 {
   gdb_byte *buf;
   enum register_status status;
@@ -677,7 +680,7 @@ regcache_raw_write_signed (struct regcache *regcache, int regnum, LONGEST val)
 
 template<typename T, typename>
 void
-regcache::raw_write (int regnum, T val)
+regcache_raw::raw_write (int regnum, T val)
 {
   gdb_byte *buf;
 
@@ -890,7 +893,7 @@ regcache_raw_write (struct regcache *regcache, int regnum,
 }
 
 void
-regcache::raw_write (int regnum, const gdb_byte *buf)
+regcache_raw::raw_write (int regnum, const gdb_byte *buf)
 {
 
   gdb_assert (buf != NULL);
@@ -1056,7 +1059,7 @@ regcache::cooked_write_part (int regnum, int offset, int len,
 /* Supply register REGNUM, whose contents are stored in BUF, to REGCACHE.  */
 
 void
-regcache_raw_supply (struct regcache *regcache, int regnum, const void *buf)
+regcache_raw_supply (regcache_raw *regcache, int regnum, const void *buf)
 {
   gdb_assert (regcache != NULL);
   regcache->raw_supply (regnum, buf);
@@ -1134,7 +1137,7 @@ reg_buffer::raw_supply_zeroed (int regnum)
 /* Collect register REGNUM from REGCACHE and store its contents in BUF.  */
 
 void
-regcache_raw_collect (const struct regcache *regcache, int regnum, void *buf)
+regcache_raw_collect (const regcache_raw *regcache, int regnum, void *buf)
 {
   gdb_assert (regcache != NULL && buf != NULL);
   regcache->raw_collect (regnum, buf);
@@ -1242,7 +1245,7 @@ reg_buffer::transfer_regset (const struct regset *regset,
 
 void
 regcache_supply_regset (const struct regset *regset,
-                       struct regcache *regcache,
+                       regcache_raw *regcache,
                        int regnum, const void *buf, size_t size)
 {
   regcache->supply_regset (regset, regnum, buf, size);
@@ -1261,7 +1264,7 @@ reg_buffer::supply_regset (const struct regset *regset,
 
 void
 regcache_collect_regset (const struct regset *regset,
-                        const struct regcache *regcache,
+                        const regcache_raw *regcache,
                         int regnum, void *buf, size_t size)
 {
   regcache->collect_regset (regset, regnum, buf, size);
@@ -1324,7 +1327,7 @@ regcache_write_pc (struct regcache *regcache, CORE_ADDR pc)
 }
 
 void
-regcache::debug_print_register (const char *func,  int regno)
+regcache_raw::debug_print_register (const char *func,  int regno)
 {
   struct gdbarch *gdbarch = arch ();
 
index a76552f33ce4e7103ea669f0877bf425b7f685c8..e7dbaad9b7cd8d91e9b9b0c7eca04f1f3f34f1c4 100644 (file)
@@ -27,6 +27,8 @@ struct regcache;
 struct regset;
 struct gdbarch;
 struct address_space;
+class regcache_raw;
+class reg_buffer;
 
 extern struct regcache *get_current_regcache (void);
 extern struct regcache *get_thread_regcache (ptid_t ptid);
@@ -37,27 +39,27 @@ extern struct regcache *get_thread_arch_aspace_regcache (ptid_t,
 
 /* Return REGCACHE's ptid.  */
 
-extern ptid_t regcache_get_ptid (const struct regcache *regcache);
+extern ptid_t regcache_get_ptid (const regcache_raw *regcache);
 
 /* Return REGCACHE's architecture.  */
 
-extern struct gdbarch *get_regcache_arch (const struct regcache *regcache);
+extern struct gdbarch *get_regcache_arch (const regcache_raw *regcache);
 
 /* Return REGCACHE's address space.  */
 
 extern struct address_space *get_regcache_aspace (const struct regcache *);
 
-enum register_status regcache_register_status (const struct regcache *regcache,
+enum register_status regcache_register_status (const reg_buffer *regcache,
                                               int regnum);
 
 /* Make certain that the register REGNUM in REGCACHE is up-to-date.  */
 
-void regcache_raw_update (struct regcache *regcache, int regnum);
+void regcache_raw_update (regcache_raw *regcache, int regnum);
 
 /* Transfer a raw register [0..NUM_REGS) between core-gdb and the
    regcache.  The read variants return the status of the register.  */
 
-enum register_status regcache_raw_read (struct regcache *regcache,
+enum register_status regcache_raw_read (regcache_raw *regcache,
                                        int rawnum, gdb_byte *buf);
 void regcache_raw_write (struct regcache *regcache, int rawnum,
                         const gdb_byte *buf);
@@ -94,7 +96,7 @@ extern enum register_status
 void regcache_raw_write_part (struct regcache *regcache, int regnum,
                              int offset, int len, const gdb_byte *buf);
 
-void regcache_invalidate (struct regcache *regcache, int regnum);
+void regcache_invalidate (regcache_raw *regcache, int regnum);
 
 /* Transfer of pseudo-registers.  The read variants return a register
    status, as an indication of when a ``cooked'' register was
@@ -143,9 +145,9 @@ extern void regcache_write_pc (struct regcache *regcache, CORE_ADDR pc);
    target.  These functions are called by the target in response to a
    target_fetch_registers() or target_store_registers().  */
 
-extern void regcache_raw_supply (struct regcache *regcache,
+extern void regcache_raw_supply (regcache_raw *regcache,
                                 int regnum, const void *buf);
-extern void regcache_raw_collect (const struct regcache *regcache,
+extern void regcache_raw_collect (const regcache_raw *regcache,
                                  int regnum, void *buf);
 
 /* Mapping between register numbers and offsets in a buffer, for use
@@ -186,11 +188,11 @@ enum
    'regset_collect' fields in a regset structure.  */
 
 extern void regcache_supply_regset (const struct regset *regset,
-                                   struct regcache *regcache,
+                                   regcache_raw *regcache,
                                    int regnum, const void *buf,
                                    size_t size);
 extern void regcache_collect_regset (const struct regset *regset,
-                                    const struct regcache *regcache,
+                                    const regcache_raw *regcache,
                                     int regnum, void *buf, size_t size);
 
 
@@ -297,9 +299,60 @@ private:
   signed char *m_register_status;
 };
 
+class regcache_raw : public reg_buffer
+{
+public:
+  regcache_raw () = delete;
+
+  enum register_status raw_read (int regnum, gdb_byte *buf);
+  void raw_write (int regnum, const gdb_byte *buf);
+
+  template<typename T, typename = RequireLongest<T>>
+  enum register_status raw_read (int regnum, T *val);
+
+  template<typename T, typename = RequireLongest<T>>
+  void raw_write (int regnum, T val);
+
+  void raw_update (int regnum);
+
+  void invalidate (int regnum);
+
+  ptid_t ptid () const
+  {
+    return m_ptid;
+  }
+
+  void set_ptid (const ptid_t ptid)
+  {
+    this->m_ptid = ptid;
+  }
+
+  gdbarch *arch () const;
+
+/* Dump the contents of a register from the register cache to the target
+   debug.  */
+  void debug_print_register (const char *func, int regno);
+
+protected:
+  regcache_raw (gdbarch *gdbarch, bool readonly_p_);
+
+  /* Is this a read-only cache?  A read-only cache is used for saving
+     the target's register state (e.g, across an inferior function
+     call or just before forcing a function return).  A read-only
+     cache can only be updated via the methods regcache_dup() and
+     regcache_cpy().  The actual contents are determined by the
+     reggroup_save and reggroup_restore methods.  */
+  bool m_readonly_p;
+
+private:
+  /* If this is a read-write cache, which thread's registers is
+     it connected to?  */
+  ptid_t m_ptid;
+};
+
 /* The register cache for storing raw register values.  */
 
-class regcache : public reg_buffer
+class regcache : public regcache_raw
 {
 public:
   regcache (gdbarch *gdbarch, address_space *aspace_)
@@ -314,8 +367,6 @@ public:
 
   DISABLE_COPY_AND_ASSIGN (regcache);
 
-  gdbarch *arch () const;
-
   address_space *aspace () const
   {
     return m_aspace;
@@ -326,16 +377,6 @@ public:
   enum register_status cooked_read (int regnum, gdb_byte *buf);
   void cooked_write (int regnum, const gdb_byte *buf);
 
-  enum register_status raw_read (int regnum, gdb_byte *buf);
-
-  void raw_write (int regnum, const gdb_byte *buf);
-
-  template<typename T, typename = RequireLongest<T>>
-  enum register_status raw_read (int regnum, T *val);
-
-  template<typename T, typename = RequireLongest<T>>
-  void raw_write (int regnum, T val);
-
   struct value *cooked_read_value (int regnum);
 
   template<typename T, typename = RequireLongest<T>>
@@ -344,10 +385,6 @@ public:
   template<typename T, typename = RequireLongest<T>>
   void cooked_write (int regnum, T val);
 
-  void raw_update (int regnum);
-
-  void invalidate (int regnum);
-
   enum register_status raw_read_part (int regnum, int offset, int len,
                                      gdb_byte *buf);
 
@@ -361,20 +398,6 @@ public:
 
   void dump (ui_file *file, enum regcache_dump_what what_to_dump);
 
-  ptid_t ptid () const
-  {
-    return m_ptid;
-  }
-
-  void set_ptid (const ptid_t ptid)
-  {
-    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, address_space *aspace_, bool readonly_p_);
@@ -391,17 +414,6 @@ private:
      makes sense, like PC or SP).  */
   struct address_space *m_aspace;
 
-  /* Is this a read-only cache?  A read-only cache is used for saving
-     the target's register state (e.g, across an inferior function
-     call or just before forcing a function return).  A read-only
-     cache can only be updated via the methods regcache_dup() and
-     regcache_cpy().  The actual contents are determined by the
-     reggroup_save and reggroup_restore methods.  */
-  bool m_readonly_p;
-  /* If this is a read-write cache, which thread's registers is
-     it connected to?  */
-  ptid_t m_ptid;
-
   friend struct regcache *
   get_thread_arch_aspace_regcache (ptid_t ptid, struct gdbarch *gdbarch,
                                   struct address_space *aspace);
index 36592cb75b3b31e8ec2da98731a606962ac6cda7..ff058d59657ed0d45c4238f93a18d418314991e7 100644 (file)
@@ -25,10 +25,10 @@ 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 *, regcache_raw *,
                                     int, const void *, size_t);
-typedef void (collect_regset_ftype) (const struct regset *, 
-                                     const struct regcache *,
+typedef void (collect_regset_ftype) (const struct regset *,
+                                     const regcache_raw *,
                                      int, void *, size_t);
 
 struct regset
index 3ceabcf1aadce7c335821e7be9e46e73619c72a1..50cf2313207c4a5e3f9b0ceb752fd8b619d156aa 100644 (file)
@@ -105,7 +105,7 @@ static int getpkt_or_notif_sane (char **buf, long *sizeof_buf,
 static void remote_files_info (struct target_ops *ignore);
 
 static void remote_prepare_to_store (struct target_ops *self,
-                                    struct regcache *regcache);
+                                    regcache_raw *regcache);
 
 static void remote_open_1 (const char *, int, struct target_ops *,
                           int extended_p);
@@ -7554,7 +7554,7 @@ remote_wait (struct target_ops *ops,
 /* Fetch a single register using a 'p' packet.  */
 
 static int
-fetch_register_using_p (struct regcache *regcache, struct packet_reg *reg)
+fetch_register_using_p (regcache_raw *regcache, struct packet_reg *reg)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
   struct remote_state *rs = get_remote_state ();
@@ -7647,7 +7647,7 @@ send_g_packet (void)
 }
 
 static void
-process_g_packet (struct regcache *regcache)
+process_g_packet (regcache_raw *regcache)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
   struct remote_state *rs = get_remote_state ();
@@ -7752,7 +7752,7 @@ process_g_packet (struct regcache *regcache)
 }
 
 static void
-fetch_registers_using_g (struct regcache *regcache)
+fetch_registers_using_g (regcache_raw *regcache)
 {
   send_g_packet ();
   process_g_packet (regcache);
@@ -7783,7 +7783,7 @@ set_remote_traceframe (void)
 
 static void
 remote_fetch_registers (struct target_ops *ops,
-                       struct regcache *regcache, int regnum)
+                       regcache_raw *regcache, int regnum)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
   remote_arch_state *rsa = get_remote_arch_state (gdbarch);
@@ -7834,7 +7834,7 @@ remote_fetch_registers (struct target_ops *ops,
    first.  */
 
 static void
-remote_prepare_to_store (struct target_ops *self, struct regcache *regcache)
+remote_prepare_to_store (struct target_ops *self, regcache_raw *regcache)
 {
   remote_arch_state *rsa = get_remote_arch_state (regcache->arch ());
   int i;
@@ -7858,7 +7858,7 @@ remote_prepare_to_store (struct target_ops *self, struct regcache *regcache)
    packet was not recognized.  */
 
 static int
-store_register_using_P (const struct regcache *regcache, 
+store_register_using_P (const regcache_raw *regcache,
                        struct packet_reg *reg)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
@@ -7899,7 +7899,7 @@ store_register_using_P (const struct regcache *regcache,
    contents of the register cache buffer.  FIXME: ignores errors.  */
 
 static void
-store_registers_using_G (const struct regcache *regcache)
+store_registers_using_G (const regcache_raw *regcache)
 {
   struct remote_state *rs = get_remote_state ();
   remote_arch_state *rsa = get_remote_arch_state (regcache->arch ());
@@ -7939,7 +7939,7 @@ store_registers_using_G (const struct regcache *regcache)
 
 static void
 remote_store_registers (struct target_ops *ops,
-                       struct regcache *regcache, int regnum)
+                       regcache_raw *regcache, int regnum)
 {
   struct gdbarch *gdbarch = regcache->arch ();
   remote_arch_state *rsa = get_remote_arch_state (gdbarch);
index dfc7404f4b88bbdf2b830bea3df304e61bc25f19..9a72bcab461f358a043dbd0f9c07fe68d271bdf7 100644 (file)
@@ -177,7 +177,7 @@ s390_write_pc (struct regcache *regcache, CORE_ADDR pc)
 
 static void
 s390_guess_tracepoint_registers (struct gdbarch *gdbarch,
-                                struct regcache *regcache,
+                                regcache_raw *regcache,
                                 CORE_ADDR addr)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
index 7477ce68ba90c7b6d8c1099f09acde1655cf166d..0d4d53460ee9cc93de34b48a0c93f84344030c28 100644 (file)
@@ -98,7 +98,7 @@
   target_debug_do_print (core_addr_to_string (*(X)))
 #define target_debug_print_int_p(X)            \
   target_debug_do_print (plongest (*(X)))
-#define target_debug_print_struct_regcache_p(X) \
+#define target_debug_print_regcache_raw_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))
index c981796e7ae0aad20f15ca62c0d0746871e4f1b6..0e6fef7c48862b14a05a750984e85b57df3e0f88 100644 (file)
@@ -159,80 +159,80 @@ debug_wait (struct target_ops *self, ptid_t arg1, struct target_waitstatus *arg2
 }
 
 static void
-delegate_fetch_registers (struct target_ops *self, struct regcache *arg1, int arg2)
+delegate_fetch_registers (struct target_ops *self, regcache_raw *arg1, int arg2)
 {
   self = self->beneath;
   self->to_fetch_registers (self, arg1, arg2);
 }
 
 static void
-tdefault_fetch_registers (struct target_ops *self, struct regcache *arg1, int arg2)
+tdefault_fetch_registers (struct target_ops *self, regcache_raw *arg1, int arg2)
 {
 }
 
 static void
-debug_fetch_registers (struct target_ops *self, struct regcache *arg1, int arg2)
+debug_fetch_registers (struct target_ops *self, regcache_raw *arg1, int arg2)
 {
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_fetch_registers (...)\n", debug_target.to_shortname);
   debug_target.to_fetch_registers (&debug_target, arg1, arg2);
   fprintf_unfiltered (gdb_stdlog, "<- %s->to_fetch_registers (", debug_target.to_shortname);
   target_debug_print_struct_target_ops_p (&debug_target);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_struct_regcache_p (arg1);
+  target_debug_print_regcache_raw_p (arg1);
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_int (arg2);
   fputs_unfiltered (")\n", gdb_stdlog);
 }
 
 static void
-delegate_store_registers (struct target_ops *self, struct regcache *arg1, int arg2)
+delegate_store_registers (struct target_ops *self, regcache_raw *arg1, int arg2)
 {
   self = self->beneath;
   self->to_store_registers (self, arg1, arg2);
 }
 
 static void
-tdefault_store_registers (struct target_ops *self, struct regcache *arg1, int arg2)
+tdefault_store_registers (struct target_ops *self, regcache_raw *arg1, int arg2)
 {
   noprocess ();
 }
 
 static void
-debug_store_registers (struct target_ops *self, struct regcache *arg1, int arg2)
+debug_store_registers (struct target_ops *self, regcache_raw *arg1, int arg2)
 {
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_store_registers (...)\n", debug_target.to_shortname);
   debug_target.to_store_registers (&debug_target, arg1, arg2);
   fprintf_unfiltered (gdb_stdlog, "<- %s->to_store_registers (", debug_target.to_shortname);
   target_debug_print_struct_target_ops_p (&debug_target);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_struct_regcache_p (arg1);
+  target_debug_print_regcache_raw_p (arg1);
   fputs_unfiltered (", ", gdb_stdlog);
   target_debug_print_int (arg2);
   fputs_unfiltered (")\n", gdb_stdlog);
 }
 
 static void
-delegate_prepare_to_store (struct target_ops *self, struct regcache *arg1)
+delegate_prepare_to_store (struct target_ops *self, regcache_raw *arg1)
 {
   self = self->beneath;
   self->to_prepare_to_store (self, arg1);
 }
 
 static void
-tdefault_prepare_to_store (struct target_ops *self, struct regcache *arg1)
+tdefault_prepare_to_store (struct target_ops *self, regcache_raw *arg1)
 {
   noprocess ();
 }
 
 static void
-debug_prepare_to_store (struct target_ops *self, struct regcache *arg1)
+debug_prepare_to_store (struct target_ops *self, regcache_raw *arg1)
 {
   fprintf_unfiltered (gdb_stdlog, "-> %s->to_prepare_to_store (...)\n", debug_target.to_shortname);
   debug_target.to_prepare_to_store (&debug_target, arg1);
   fprintf_unfiltered (gdb_stdlog, "<- %s->to_prepare_to_store (", debug_target.to_shortname);
   target_debug_print_struct_target_ops_p (&debug_target);
   fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_struct_regcache_p (arg1);
+  target_debug_print_regcache_raw_p (arg1);
   fputs_unfiltered (")\n", gdb_stdlog);
 }
 
index f2dccd23ced7034a35e843a7a6527bed5d993945..6f45bb28c58bd22ecd3c88efb1de3b5c6ffd5735 100644 (file)
@@ -3443,7 +3443,7 @@ target_options_to_string (int target_options)
 }
 
 void
-target_fetch_registers (struct regcache *regcache, int regno)
+target_fetch_registers (regcache_raw *regcache, int regno)
 {
   current_target.to_fetch_registers (&current_target, regcache, regno);
   if (targetdebug)
@@ -3451,7 +3451,7 @@ target_fetch_registers (struct regcache *regcache, int regno)
 }
 
 void
-target_store_registers (struct regcache *regcache, int regno)
+target_store_registers (regcache_raw *regcache, int regno)
 {
   if (!may_write_registers)
     error (_("Writing to registers is not allowed (regno %d)"), regno);
index f5ad1e5ca8c4496e5130568ada1a47ae87156067..c7cb63db9839ee4c0f843c8474cea64a2869789f 100644 (file)
@@ -475,11 +475,11 @@ struct target_ops
                       ptid_t, struct target_waitstatus *,
                       int TARGET_DEBUG_PRINTER (target_debug_print_options))
       TARGET_DEFAULT_FUNC (default_target_wait);
-    void (*to_fetch_registers) (struct target_ops *, struct regcache *, int)
+    void (*to_fetch_registers) (struct target_ops *, regcache_raw *, int)
       TARGET_DEFAULT_IGNORE ();
-    void (*to_store_registers) (struct target_ops *, struct regcache *, int)
+    void (*to_store_registers) (struct target_ops *, regcache_raw *, int)
       TARGET_DEFAULT_NORETURN (noprocess ());
-    void (*to_prepare_to_store) (struct target_ops *, struct regcache *)
+    void (*to_prepare_to_store) (struct target_ops *, regcache_raw *)
       TARGET_DEFAULT_NORETURN (noprocess ());
 
     void (*to_files_info) (struct target_ops *)
@@ -1401,13 +1401,13 @@ 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 (regcache_raw *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
    must have been previously called.  Calls error() if there are problems.  */
 
-extern void target_store_registers (struct regcache *regcache, int regs);
+extern void target_store_registers (regcache_raw *regcache, int regs);
 
 /* Get ready to modify the registers array.  On machines which store
    individual registers, this doesn't need to do anything.  On machines
index 7288e7c261ec1c336b49b1d51c7061f667608d4e..4ec655d27441fc728c9592fb4160208f3062b1e5 100644 (file)
@@ -841,7 +841,7 @@ traceframe_find_block_type (char type_wanted, int pos)
 
 static void
 tfile_fetch_registers (struct target_ops *ops,
-                      struct regcache *regcache, int regno)
+                      regcache_raw *regcache, int regno)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
   int offset, regn, regsize, dummy;
index b6a800cf7d19a2adeb02809b6c8a8f7bc78f116a..e93bb041f1f492669239bb242557ca7f1b723d3e 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 (regcache_raw *regcache, int regno)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
   struct tracepoint *tp = get_tracepoint (get_tracepoint_number ());
index e6d4460d3efd2ccec473c60a0ba79a1137e4dce5..3fb9f3d76e877b372da04cf9c751665ffd86c6ed 100644 (file)
@@ -115,6 +115,6 @@ extern struct trace_file_writer *tfile_trace_file_writer_new (void);
 
 extern void init_tracefile_ops (struct target_ops *ops);
 
-extern void tracefile_fetch_registers (struct regcache *regcache, int regno);
+extern void tracefile_fetch_registers (regcache_raw *regcache, int regno);
 
 #endif /* TRACEFILE_H */