2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_get_ptid): Remove, update all callers to
+ call regcache::ptid instead.
+ * regcache.c (regcache_get_ptid): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* Makefile.in (ALL_TARGET_OBS): Add or1k-tdep.o.
2018-05-30 Pedro Alves <palves@redhat.com>
aarch64_fbsd_nat_target::fetch_registers (struct regcache *regcache,
int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
aarch64_fbsd_nat_target::store_registers (struct regcache *regcache,
int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
and arm. */
gdb_static_assert (sizeof (regs) >= 18 * 4);
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
iovec.iov_base = ®s;
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
/* Make sure REGS can hold all registers contents on both aarch64
and arm. */
gdb_static_assert (sizeof (regs) >= 18 * 4);
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
iovec.iov_base = ®s;
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
and arm. */
gdb_static_assert (sizeof regs >= VFP_REGS_SIZE);
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
iovec.iov_base = ®s;
/* Make sure REGS can hold all VFP registers contents on both aarch64
and arm. */
gdb_static_assert (sizeof regs >= VFP_REGS_SIZE);
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
iovec.iov_base = ®s;
pthdb_tid_t tid;
struct target_ops *beneath = find_target_beneath (this);
- if (!PD_TID (regcache_get_ptid (regcache)))
+ if (!PD_TID (regcache->ptid ()))
beneath->fetch_registers (regcache, regno);
else
{
- thread = find_thread_ptid (regcache_get_ptid (regcache));
+ thread = find_thread_ptid (regcache->ptid ());
aix_thread_info *priv = get_aix_thread_info (thread);
tid = priv->tid;
pthdb_tid_t tid;
struct target_ops *beneath = find_target_beneath (this);
- if (!PD_TID (regcache_get_ptid (regcache)))
+ if (!PD_TID (regcache->ptid ()))
beneath->store_registers (regcache, regno);
else
{
- thread = find_thread_ptid (regcache_get_ptid (regcache));
+ thread = find_thread_ptid (regcache->ptid ());
aix_thread_info *priv = get_aix_thread_info (thread);
tid = priv->tid;
{
struct reg gregs;
- if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &gregs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
{
struct fpreg fpregs;
- if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status"));
if (regno == -1 || getregs_supplies (regno))
{
struct reg gregs;
- if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &gregs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
alphabsd_fill_reg (regcache, (char *) &gregs, regno);
- if (ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &gregs, 0) == -1)
perror_with_name (_("Couldn't write registers"));
{
struct fpreg fpregs;
- if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status"));
alphabsd_fill_fpreg (regcache, (char *) &fpregs, regno);
- if (ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't write floating point status"));
}
amd64bsd_fetch_inferior_registers (struct regcache *regcache, int regnum)
{
struct gdbarch *gdbarch = regcache->arch ();
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
{
amd64bsd_store_inferior_registers (struct regcache *regcache, int regnum)
{
struct gdbarch *gdbarch = regcache->arch ();
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
{
int tid;
/* GNU/Linux LWP ID's are process ID's. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
if (tid == 0)
- tid = ptid_get_pid (regcache_get_ptid (regcache)); /* Not a threaded program. */
+ tid = ptid_get_pid (regcache->ptid ()); /* Not a threaded program. */
if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
{
int tid;
/* GNU/Linux LWP ID's are process ID's. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
if (tid == 0)
- tid = ptid_get_pid (regcache_get_ptid (regcache)); /* Not a threaded program. */
+ tid = ptid_get_pid (regcache->ptid ()); /* Not a threaded program. */
if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
{
void
arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
void
arm_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
gdb_byte fp[ARM_LINUX_SIZEOF_NWFPE];
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
/* Read the floating point state. */
if (have_ptrace_getregset == TRIBOOL_TRUE)
gdb_byte fp[ARM_LINUX_SIZEOF_NWFPE];
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
/* Read the floating point state. */
if (have_ptrace_getregset == TRIBOOL_TRUE)
elf_gregset_t regs;
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
if (have_ptrace_getregset == TRIBOOL_TRUE)
{
elf_gregset_t regs;
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
/* Fetch the general registers. */
if (have_ptrace_getregset == TRIBOOL_TRUE)
int ret, regno, tid;
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
ret = ptrace (PTRACE_GETWMMXREGS, tid, 0, regbuf);
if (ret < 0)
int ret, regno, tid;
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
ret = ptrace (PTRACE_GETWMMXREGS, tid, 0, regbuf);
if (ret < 0)
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
if (have_ptrace_getregset == TRIBOOL_TRUE)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
if (have_ptrace_getregset == TRIBOOL_TRUE)
{
struct reg inferior_registers;
int ret;
- ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
int ret;
int regno;
- ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
struct fpreg inferior_fp_registers;
int ret;
- ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
int ret;
int regno;
- ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
struct reg inferior_registers;
int ret;
- ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
break;
}
- ret = ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
inferior_registers.r_pc = pc_val | psr_val;
}
- ret = ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
struct fpreg inferior_fp_registers;
int ret;
- ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
break;
}
- ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
regcache_raw_collect (regcache, ARM_FPS_REGNUM,
(char *) &inferior_fp_registers.fpr_fpsr);
- ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
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_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
CORE_ADDR addr = ptid_get_tid (ptid);
struct target_ops *beneath = find_target_beneath (this);
CORE_ADDR active_addr;
struct bsd_uthread_ops *uthread_ops
= (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data);
struct target_ops *beneath = find_target_beneath (this);
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
CORE_ADDR addr = ptid_get_tid (ptid);
CORE_ADDR active_addr;
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
errno = 0;
val = ptrace (PTRACE_PEEKUSER, tid, hppa_linux_register_addr (regno, 0), 0);
if (gdbarch_cannot_store_register (gdbarch, regno))
return;
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
errno = 0;
regcache_raw_collect (regcache, regno, &val);
hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || hppanbsd_gregset_supplies_p (regnum))
{
void
hppa_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || hppanbsd_gregset_supplies_p (regnum))
{
void
hppa_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || hppaobsd_gregset_supplies_p (regnum))
{
void
i386bsd_fetch_inferior_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || GETREGS_SUPPLIES (regnum))
{
void
i386bsd_store_inferior_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || GETREGS_SUPPLIES (regnum))
{
void
i386_darwin_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
- thread_t current_thread = ptid_get_tid (regcache_get_ptid (regcache));
+ thread_t current_thread = ptid_get_tid (regcache->ptid ());
int fetched = 0;
struct gdbarch *gdbarch = regcache->arch ();
i386_darwin_nat_target::store_registers (struct regcache *regcache,
int regno)
{
- thread_t current_thread = ptid_get_tid (regcache_get_ptid (regcache));
+ thread_t current_thread = ptid_get_tid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
#ifdef BFD64
struct regcache *regcache, int regno)
{
struct proc *thread;
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
/* Make sure we know about new threads. */
inf_update_procs (gnu_current_inf);
{
struct proc *thread;
struct gdbarch *gdbarch = regcache->arch ();
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
/* Make sure we know about new threads. */
inf_update_procs (gnu_current_inf);
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
errno = 0;
val = ptrace (PTRACE_PEEKUSER, tid,
if (i386_linux_gregset_reg_offset[regno] == -1)
return;
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
errno = 0;
regcache_raw_collect (regcache, regno, &val);
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_GETFPXREGS request whenever possible, since it
transfers more registers in one system call, and we'll cache the
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_SETFPXREGS requests whenever possible, since it
transfers more registers in one system call. But remember that
return;
}
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
/* This isn't really an address, but ptrace thinks of it as one. */
addr = ia64_register_addr (gdbarch, regnum);
if (ia64_cannot_store_register (gdbarch, regnum))
return;
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
/* This isn't really an address, but ptrace thinks of it as one. */
addr = ia64_register_addr (gdbarch, regnum);
return;
}
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
size = register_size (gdbarch, regnum);
buf = (gdb_byte *) alloca (size);
|| gdbarch_cannot_store_register (gdbarch, regnum))
return;
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
size = register_size (gdbarch, regnum);
buf = (gdb_byte *) alloca (size);
void
m32r_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_GETREGS request whenever possible, since it
transfers more registers in one system call, and we'll cache the
void
m32r_linux_nat_target::store_registers (struct regcache *regcache, int regno)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_SETREGS request whenever possible, since it
transfers more registers in one system call. */
void
m68k_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum))
{
void
m68k_bsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum))
{
long regaddr, val;
int i;
gdb_byte buf[M68K_MAX_REGISTER_SIZE];
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
regaddr = 4 * regmap[regno];
for (i = 0; i < register_size (gdbarch, regno); i += sizeof (long))
long regaddr, val;
int i;
gdb_byte buf[M68K_MAX_REGISTER_SIZE];
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
regaddr = 4 * regmap[regno];
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_GETFPXREGS request whenever possible, since it
transfers more registers in one system call, and we'll cache the
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_SETFPREGS requests whenever possible, since it
transfers more registers in one system call. But remember that
void
mips_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
void
mips_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
else
is_dsp = 0;
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
if (regno == -1 || (!is_fp && !is_dsp))
{
else
is_dsp = 0;
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
if (regno == -1 || (!is_fp && !is_dsp))
{
void
mips_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regno == -1 || getregs_supplies (gdbarch, regno))
void
mips_nbsd_nat_target::store_registers (struct regcache *regcache, int regno)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regno == -1 || getregs_supplies (gdbarch, regno))
mips64_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
mips64_obsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
reg;
int regsize;
- procfs_set_thread (regcache_get_ptid (regcache));
+ procfs_set_thread (regcache->ptid ());
if (devctl (ctl_fd, DCMD_PROC_GETGREG, ®, sizeof (reg), ®size) == EOK)
nto_supply_gregset (regcache, (char *) ®.greg);
if (devctl (ctl_fd, DCMD_PROC_GETFPREG, ®, sizeof (reg), ®size)
unsigned off;
int len, regset, regsize, dev_set, err;
char *data;
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (ptid_equal (ptid, null_ptid))
return;
ppc_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
gdb_gregset_t regs;
- pid_t pid = ptid_get_lwp (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_lwp (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
ppc_fbsd_nat_target::store_registers (struct regcache *regcache, int regno)
{
gdb_gregset_t regs;
- pid_t pid = ptid_get_lwp (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_lwp (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
void
ppc_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (regno == -1)
fetch_ppc_registers (regcache, tid);
void
ppc_linux_nat_target::store_registers (struct regcache *regcache, int regno)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (regno >= 0)
store_register (regcache, tid, regno);
ppc_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
struct gdbarch *gdbarch = regcache->arch ();
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
{
ppc_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
struct gdbarch *gdbarch = regcache->arch ();
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
{
ppc_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
ppc_obsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
{
gdb_gregset_t *gregs;
procinfo *pi;
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
int pid = ptid_get_pid (ptid);
int tid = ptid_get_lwp (ptid);
struct gdbarch *gdbarch = regcache->arch ();
{
gdb_gregset_t *gregs;
procinfo *pi;
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
int pid = ptid_get_pid (ptid);
int tid = ptid_get_lwp (ptid);
struct gdbarch *gdbarch = regcache->arch ();
ravenscar_thread_target::fetch_registers (struct regcache *regcache, int regnum)
{
struct target_ops *beneath = find_target_beneath (this);
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (ravenscar_runtime_initialized ()
&& is_ravenscar_task (ptid)
int regnum)
{
target_ops *beneath = find_target_beneath (this);
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (ravenscar_runtime_initialized ()
&& is_ravenscar_task (ptid)
ravenscar_thread_target::prepare_to_store (struct regcache *regcache)
{
target_ops *beneath = find_target_beneath (this);
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (ravenscar_runtime_initialized ()
&& is_ravenscar_task (ptid)
struct btrace_insn_iterator *replay;
struct thread_info *tp;
- tp = find_thread_ptid (regcache_get_ptid (regcache));
+ tp = find_thread_ptid (regcache->ptid ());
gdb_assert (tp != NULL);
replay = tp->btrace.replay;
struct target_ops *t;
if (!record_btrace_generating_corefile
- && record_is_replaying (regcache_get_ptid (regcache)))
+ && record_is_replaying (regcache->ptid ()))
error (_("Cannot write registers while replaying."));
gdb_assert (may_write_registers != 0);
record_btrace_target::prepare_to_store (struct regcache *regcache)
{
if (!record_btrace_generating_corefile
- && record_is_replaying (regcache_get_ptid (regcache)))
+ && record_is_replaying (regcache->ptid ()))
return;
this->beneath->prepare_to_store (regcache);
return m_descr->gdbarch;
}
-/* See regcache.h. */
-
-ptid_t
-regcache_get_ptid (const struct regcache *regcache)
-{
- gdb_assert (!ptid_equal (regcache->ptid (), minus_one_ptid));
-
- return regcache->ptid ();
-}
-
/* Cleanup class for invalidating a register. */
class regcache_invalidator
struct gdbarch *,
struct address_space *);
-/* Return REGCACHE's ptid. */
-
-extern ptid_t regcache_get_ptid (const struct regcache *regcache);
-
enum register_status regcache_register_status (const struct regcache *regcache,
int regnum);
void collect_regset (const struct regset *regset, int regnum,
void *buf, size_t size) const;
+ /* Return REGCACHE's ptid. */
+
ptid_t ptid () const
{
+ gdb_assert (m_ptid != minus_one_ptid);
+
return m_ptid;
}
gdbsim_target::fetch_registers (struct regcache *regcache, int regno)
{
struct gdbarch *gdbarch = regcache->arch ();
- struct inferior *inf = find_inferior_ptid (regcache_get_ptid (regcache));
+ struct inferior *inf = find_inferior_ptid (regcache->ptid ());
struct sim_inferior_data *sim_data
= get_sim_inferior_data (inf, SIM_INSTANCE_NEEDED);
gdbsim_target::store_registers (struct regcache *regcache, int regno)
{
struct gdbarch *gdbarch = regcache->arch ();
- struct inferior *inf = find_inferior_ptid (regcache_get_ptid (regcache));
+ struct inferior *inf = find_inferior_ptid (regcache->ptid ());
struct sim_inferior_data *sim_data
= get_sim_inferior_data (inf, SIM_INSTANCE_NEEDED);
int i;
set_remote_traceframe ();
- set_general_thread (regcache_get_ptid (regcache));
+ set_general_thread (regcache->ptid ());
if (regnum >= 0)
{
int i;
set_remote_traceframe ();
- set_general_thread (regcache_get_ptid (regcache));
+ set_general_thread (regcache->ptid ());
if (regnum >= 0)
{
struct gdbarch *gdbarch = regcache->arch ();
int addr[PPC_MAX_REGISTER_SIZE];
int nr, isfloat;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
/* Retrieved values may be -1, so infer errors from errno. */
errno = 0;
struct gdbarch *gdbarch = regcache->arch ();
int addr[PPC_MAX_REGISTER_SIZE];
int nr, isfloat;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
/* Fetch the register's value from the register cache. */
regcache_raw_collect (regcache, regno, addr);
void
s390_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum))
fetch_regs (regcache, tid);
void
s390_linux_nat_target::store_registers (struct regcache *regcache, int regnum)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum))
store_regs (regcache, tid, regnum);
void
sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno))
{
void
sh_nbsd_nat_target::store_registers (struct regcache *regcache, int regno)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno))
{
gdb_gregset_t *gregset_p = &gregset;
gdb_fpregset_t *fpregset_p = &fpregset;
struct target_ops *beneath = find_target_beneath (this);
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (!ptid_tid_p (ptid))
{
td_err_e val;
prgregset_t gregset;
prfpregset_t fpregset;
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (!ptid_tid_p (ptid))
{
These functions should instead be paramaterized with an explicit
object (struct regcache, struct thread_info?) into which the LWPs
registers can be written. */
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
if (regnum == SPARC_G0_REGNUM)
{
/* NOTE: cagney/2002-12-02: See comment in fetch_inferior_registers
about threaded assumptions. */
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || sparc_gregset_supplies_p (gdbarch, regnum))
{
/* 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_get_ptid (regcache));
+ = make_scoped_restore (&inferior_ptid, regcache->ptid ());
/* We must be stopped on a spu_run system call. */
if (!parse_spufs_run (&fd, &addr))
/* 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_get_ptid (regcache));
+ = make_scoped_restore (&inferior_ptid, regcache->ptid ());
/* We must be stopped on a spu_run system call. */
if (!parse_spufs_run (&fd, &addr))
/* 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_get_ptid (regcache));
+ = make_scoped_restore (&inferior_ptid, regcache->ptid ());
/* This version applies only if we're currently in spu_run. */
if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu)
/* 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_get_ptid (regcache));
+ = make_scoped_restore (&inferior_ptid, regcache->ptid ());
/* This version applies only if we're currently in spu_run. */
if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu)
int regnum)
{
elf_gregset_t regs;
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (ptrace (PTRACE_GETREGS, tid, 0, (PTRACE_TYPE_ARG3) ®s) < 0)
perror_with_name (_("Couldn't get registers"));
int regnum)
{
elf_gregset_t regs;
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (ptrace (PTRACE_GETREGS, tid, 0, (PTRACE_TYPE_ARG3) ®s) < 0)
perror_with_name (_("Couldn't get registers"));
vax_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
vax_bsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
void
windows_nat_target::fetch_registers (struct regcache *regcache, int r)
{
- DWORD pid = ptid_get_tid (regcache_get_ptid (regcache));
+ DWORD pid = ptid_get_tid (regcache->ptid ());
windows_thread_info *th = thread_rec (pid, TRUE);
/* Check if TH exists. Windows sometimes uses a non-existent
void
windows_nat_target::store_registers (struct regcache *regcache, int r)
{
- DWORD pid = ptid_get_tid (regcache_get_ptid (regcache));
+ DWORD pid = ptid_get_tid (regcache->ptid ());
windows_thread_info *th = thread_rec (pid, TRUE);
/* Check if TH exists. Windows sometimes uses a non-existent
static void
fetch_gregs (struct regcache *regcache, int regnum)
{
- int tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ int tid = ptid_get_lwp (regcache->ptid ());
gdb_gregset_t regs;
int areg;
static void
store_gregs (struct regcache *regcache, int regnum)
{
- int tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ int tid = ptid_get_lwp (regcache->ptid ());
gdb_gregset_t regs;
int areg;
static void
fetch_xtregs (struct regcache *regcache, int regnum)
{
- int tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ int tid = ptid_get_lwp (regcache->ptid ());
const xtensa_regtable_t *ptr;
char xtregs [XTENSA_ELF_XTREG_SIZE];
static void
store_xtregs (struct regcache *regcache, int regnum)
{
- int tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ int tid = ptid_get_lwp (regcache->ptid ());
const xtensa_regtable_t *ptr;
char xtregs [XTENSA_ELF_XTREG_SIZE];