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;
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;
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;
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;
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);
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);
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;
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;
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;
static void
aarch64_linux_fetch_inferior_registers (struct target_ops *ops,
- struct regcache *regcache,
+ regcache_raw *regcache,
int regno)
{
if (regno == -1)
static void
aarch64_linux_store_inferior_registers (struct target_ops *ops,
- struct regcache *regcache,
+ regcache_raw *regcache,
int regno)
{
if (regno == -1)
void
default_guess_tracepoint_registers (struct gdbarch *gdbarch,
- struct regcache *regcache,
+ regcache_raw *regcache,
CORE_ADDR addr)
{
int pc_regno = gdbarch_pc_regnum (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);
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);
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;
#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;
}
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;
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;
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;
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;
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;
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,
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,
static void
get_core_registers (struct target_ops *ops,
- struct regcache *regcache, int regno)
+ regcache_raw *regcache, int regno)
{
int i;
struct gdbarch *gdbarch;
}
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)
{
}
}
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);
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. */
# 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
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);
static void
inf_child_fetch_inferior_registers (struct target_ops *ops,
- struct regcache *regcache, int regnum)
+ regcache_raw *regcache, int regnum)
{
if (regnum == -1)
{
static void
inf_child_store_inferior_registers (struct target_ops *ops,
- struct regcache *regcache, int regnum)
+ regcache_raw *regcache, int regnum)
{
}
static void
inf_child_prepare_to_store (struct target_ops *self,
- struct regcache *regcache)
+ regcache_raw *regcache)
{
}
/* 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;
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
/* 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;
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;
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;
static void
record_btrace_store_registers (struct target_ops *ops,
- struct regcache *regcache, int regno)
+ regcache_raw *regcache, int regno)
{
struct target_ops *t;
static void
record_btrace_prepare_to_store (struct target_ops *ops,
- struct regcache *regcache)
+ regcache_raw *regcache)
{
struct target_ops *t;
/* 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);
/* 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;
/* 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 ();
static void
record_full_store_registers (struct target_ops *ops,
- struct regcache *regcache,
+ regcache_raw *regcache,
int regno)
{
if (!record_full_gdb_operation_disable)
static void
record_full_core_fetch_registers (struct target_ops *ops,
- struct regcache *regcache,
+ regcache_raw *regcache,
int regno)
{
if (regno < 0)
static void
record_full_core_prepare_to_store (struct target_ops *self,
- struct regcache *regcache)
+ regcache_raw *regcache)
{
}
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,
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);
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)
{
}
gdbarch *
-regcache::arch () const
+regcache_raw::arch () const
{
return m_descr->gdbarch;
}
/* 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));
{
public:
- regcache_invalidator (struct regcache *regcache, int regnum)
+ regcache_invalidator (regcache_raw *regcache, int regnum)
: m_regcache (regcache),
m_regnum (regnum)
{
~regcache_invalidator ()
{
if (m_regcache != nullptr)
- regcache_invalidate (m_regcache, m_regnum);
+ m_regcache->invalidate (m_regnum);
}
DISABLE_COPY_AND_ASSIGN (regcache_invalidator);
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 ();
}
}
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);
}
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);
}
void
-regcache_raw_update (struct regcache *regcache, int regnum)
+regcache_raw_update (regcache_raw *regcache, int regnum)
{
gdb_assert (regcache != NULL);
}
void
-regcache::raw_update (int regnum)
+regcache_raw::raw_update (int regnum)
{
gdb_assert (regnum >= 0 && regnum < m_descr->nr_raw_registers);
}
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);
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;
template<typename T, typename>
void
-regcache::raw_write (int regnum, T val)
+regcache_raw::raw_write (int regnum, T val)
{
gdb_byte *buf;
}
void
-regcache::raw_write (int regnum, const gdb_byte *buf)
+regcache_raw::raw_write (int regnum, const gdb_byte *buf)
{
gdb_assert (buf != NULL);
/* 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);
/* 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);
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);
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);
}
void
-regcache::debug_print_register (const char *func, int regno)
+regcache_raw::debug_print_register (const char *func, int regno)
{
struct gdbarch *gdbarch = arch ();
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);
/* 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);
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
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
'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);
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_)
DISABLE_COPY_AND_ASSIGN (regcache);
- gdbarch *arch () const;
-
address_space *aspace () const
{
return m_aspace;
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>>
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);
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_);
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);
/* 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
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);
/* 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 ();
}
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 ();
}
static void
-fetch_registers_using_g (struct regcache *regcache)
+fetch_registers_using_g (regcache_raw *regcache)
{
send_g_packet ();
process_g_packet (regcache);
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);
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;
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);
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 ());
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);
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);
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))
}
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);
}
}
void
-target_fetch_registers (struct regcache *regcache, int regno)
+target_fetch_registers (regcache_raw *regcache, int regno)
{
current_target.to_fetch_registers (¤t_target, regcache, regno);
if (targetdebug)
}
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);
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 *)
/* 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
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;
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 ());
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 */