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;
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;
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,
{
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;
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 ();
and arm. */
gdb_static_assert (sizeof (regs) >= 18 * 4);
- tid = ptid_get_lwp (regcache->ptid ());
+ tid = ptid.lwp ();
iovec.iov_base = ®s;
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
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;
and arm. */
gdb_static_assert (sizeof regs >= VFP_REGS_SIZE);
- tid = ptid_get_lwp (regcache->ptid ());
+ tid = ptid.lwp ();
iovec.iov_base = ®s;
/* 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. */
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;
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;
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;
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;
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;
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;
}
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;
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 *);
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);
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)
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))
{
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);
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;
/* 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
#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 ();
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 ();
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 ();
/* 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 ();
-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
void
default_guess_tracepoint_registers (struct gdbarch *gdbarch,
- struct regcache *regcache,
+ reg_buffer *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,
+ reg_buffer *regcache,
CORE_ADDR addr);
extern int default_print_insn (bfd_vma memaddr, disassemble_info *info);
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;
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;
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 ();
#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;
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;
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;
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);
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;
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);
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);
}
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;
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
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));
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,
}
/* 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,
}
/* 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 ();
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,
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)
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
/* 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-
/* 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;
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);
}
/* 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);
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)
{
{ 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,
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;
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,
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;
}
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);
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. */
# 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
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);
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;
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 };
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;
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);
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);
#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 ();
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 ();
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 ();
*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);
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;
/* 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 ();
*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
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
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 };
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;
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
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;
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 ();
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;
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);
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 ();
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 ();
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 ());
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 ());
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);
}
/* 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;
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));
/* 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 ();
/* 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;
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));
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 ();
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));
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 ());
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 ());
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;
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;
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
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;
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;
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++;
}
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
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
}
/* 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;
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
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);
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 ();
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);
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
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
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,
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
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
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;
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;
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;
}
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)
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
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 *);
};
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;
/* 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;
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. */
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,
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 ++)
/* "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)
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
}
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;
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);
}
}
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);
}
void
-regcache::debug_print_register (const char *func, int regno)
+reg_buffer::debug_print_register (const char *func, int regno)
{
struct gdbarch *gdbarch = arch ();
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,
};
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);
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. */
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);
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:
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;
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
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
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_);
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);
/* 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 *,
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;
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);
/* 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 ();
}
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 ();
}
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);
}
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 ();
int i;
set_remote_traceframe ();
- set_general_thread (regcache->ptid ());
+ set_general_thread (ptid);
if (regnum >= 0)
{
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);
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)
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 ();
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 ();
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);
}
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);
static void
score7_linux_supply_gregset(const struct regset *regset,
- struct regcache *regcache,
+ reg_buffer *regcache,
int regnum, const void *buf,
size_t size)
{
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 ();
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,
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);
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);
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);
#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 ();
#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);
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);
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);
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);
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 ++)
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);
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);
/* 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);
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;
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
\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);
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,
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);
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);
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,
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);
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);
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);
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;
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);
#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 ();
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);
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);
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 ();
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
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,
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,
/* 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);
/* 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;
}
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) \
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;
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;
}
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);
}
}
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);
}
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 ());
/* 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
{ 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,
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;
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 ());
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 */
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;
static void
xtensa_supply_gregset (const struct regset *regset,
- struct regcache *rc,
+ reg_buffer *rc,
int regnum,
const void *gregs,
size_t len)