Remove regcache_get_ptid

Remove regcache_get_ptid, change all callers to call the regcache method
directly.

gdb/ChangeLog:

	* regcache.h (regcache_get_ptid): Remove, update all callers to
	call regcache::ptid instead.
	* regcache.c (regcache_get_ptid): Remove.
This commit is contained in:
Simon Marchi 2018-05-30 14:54:34 -04:00
parent 1869e86f2e
commit 222312d359
50 changed files with 135 additions and 139 deletions

View File

@ -1,3 +1,9 @@
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.

View File

@ -60,7 +60,7 @@ void
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))
@ -93,7 +93,7 @@ void
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))

View File

@ -208,7 +208,7 @@ fetch_gregs_from_thread (struct regcache *regcache)
and arm. */
gdb_static_assert (sizeof (regs) >= 18 * 4);
tid = ptid_get_lwp (regcache_get_ptid (regcache));
tid = ptid_get_lwp (regcache->ptid ());
iovec.iov_base = &regs;
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
@ -245,7 +245,7 @@ store_gregs_to_thread (const struct regcache *regcache)
/* 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 = &regs;
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
@ -289,7 +289,7 @@ fetch_fpregs_from_thread (struct regcache *regcache)
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 = &regs;
@ -336,7 +336,7 @@ store_fpregs_to_thread (const struct regcache *regcache)
/* 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 = &regs;

View File

@ -1365,11 +1365,11 @@ aix_thread_target::fetch_registers (struct regcache *regcache, int regno)
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;
@ -1719,11 +1719,11 @@ aix_thread_target::store_registers (struct regcache *regcache, int regno)
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;

View File

@ -98,7 +98,7 @@ alpha_bsd_nat_target::fetch_registers (struct regcache *regcache, int 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"));
@ -112,7 +112,7 @@ alpha_bsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
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"));
@ -129,13 +129,13 @@ alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno)
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"));
@ -148,13 +148,13 @@ alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno)
{
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"));
}

View File

@ -42,7 +42,7 @@ void
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))
{
@ -115,7 +115,7 @@ void
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))
{

View File

@ -148,9 +148,9 @@ amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int 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))
{
@ -226,9 +226,9 @@ amd64_linux_nat_target::store_registers (struct regcache *regcache, int 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))
{

View File

@ -64,7 +64,7 @@ getvfpregs_supplies (struct gdbarch *gdbarch, int 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))
@ -98,7 +98,7 @@ arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int 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))

View File

@ -119,7 +119,7 @@ fetch_fpregs (struct regcache *regcache)
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)
@ -156,7 +156,7 @@ store_fpregs (const struct regcache *regcache)
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)
@ -210,7 +210,7 @@ fetch_regs (struct regcache *regcache)
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)
{
@ -237,7 +237,7 @@ store_regs (const struct regcache *regcache)
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)
@ -285,7 +285,7 @@ fetch_wmmx_regs (struct regcache *regcache)
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)
@ -311,7 +311,7 @@ store_wmmx_regs (const struct regcache *regcache)
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)
@ -350,7 +350,7 @@ fetch_vfp_regs (struct regcache *regcache)
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)
{
@ -379,7 +379,7 @@ store_vfp_regs (const struct regcache *regcache)
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)
{

View File

@ -87,7 +87,7 @@ fetch_register (struct regcache *regcache, int regno)
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)
@ -140,7 +140,7 @@ fetch_regs (struct regcache *regcache)
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)
@ -158,7 +158,7 @@ fetch_fp_register (struct regcache *regcache, int regno)
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)
@ -188,7 +188,7 @@ fetch_fp_regs (struct regcache *regcache)
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)
@ -225,7 +225,7 @@ store_register (const struct regcache *regcache, int regno)
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)
@ -288,7 +288,7 @@ store_register (const struct regcache *regcache, int regno)
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)
@ -336,7 +336,7 @@ store_regs (const struct regcache *regcache)
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)
@ -349,7 +349,7 @@ store_fp_register (const struct regcache *regcache, int regno)
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)
@ -371,7 +371,7 @@ store_fp_register (const struct regcache *regcache, int regno)
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)
@ -393,7 +393,7 @@ store_fp_regs (const struct regcache *regcache)
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)

View File

@ -321,7 +321,7 @@ bsd_uthread_target::fetch_registers (struct regcache *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_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;
@ -355,7 +355,7 @@ bsd_uthread_target::store_registers (struct regcache *regcache, int regnum)
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);

View File

@ -233,7 +233,7 @@ fetch_register (struct regcache *regcache, int regno)
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);
@ -257,7 +257,7 @@ store_register (const struct regcache *regcache, int regno)
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);

View File

@ -170,7 +170,7 @@ void
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))
{
@ -199,7 +199,7 @@ hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int 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))
{

View File

@ -196,7 +196,7 @@ hppaobsd_collect_fpregset (struct regcache *regcache,
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))
{

View File

@ -130,7 +130,7 @@ i386bsd_collect_gregset (const struct regcache *regcache,
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))
{
@ -193,7 +193,7 @@ i386bsd_fetch_inferior_registers (struct regcache *regcache, int 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))
{

View File

@ -59,7 +59,7 @@ static struct i386_darwin_nat_target darwin_target;
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 ();
@ -176,7 +176,7 @@ void
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

View File

@ -108,7 +108,7 @@ gnu_fetch_registers (struct target_ops *ops,
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);
@ -201,7 +201,7 @@ gnu_store_registers (struct target_ops *ops,
{
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);

View File

@ -116,7 +116,7 @@ fetch_register (struct regcache *regcache, int regno)
return;
}
tid = get_ptrace_pid (regcache_get_ptid (regcache));
tid = get_ptrace_pid (regcache->ptid ());
errno = 0;
val = ptrace (PTRACE_PEEKUSER, tid,
@ -141,7 +141,7 @@ store_register (const struct regcache *regcache, int regno)
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);
@ -475,7 +475,7 @@ i386_linux_nat_target::fetch_registers (struct regcache *regcache, int 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
@ -552,7 +552,7 @@ i386_linux_nat_target::store_registers (struct regcache *regcache, int regno)
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

View File

@ -779,7 +779,7 @@ ia64_linux_fetch_register (struct regcache *regcache, int 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);
@ -833,7 +833,7 @@ ia64_linux_store_register (const struct regcache *regcache, int 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);

View File

@ -45,7 +45,7 @@ linux_nat_trad_target::fetch_register (struct regcache *regcache, int 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);
@ -104,7 +104,7 @@ linux_nat_trad_target::store_register (const struct regcache *regcache,
|| 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);

View File

@ -202,7 +202,7 @@ fill_fpregset (const struct regcache *regcache,
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
@ -223,7 +223,7 @@ m32r_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
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. */

View File

@ -118,7 +118,7 @@ m68kbsd_collect_fpregset (struct regcache *regcache,
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))
{
@ -147,7 +147,7 @@ m68k_bsd_nat_target::fetch_registers (struct regcache *regcache, int 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))
{

View File

@ -119,7 +119,7 @@ fetch_register (struct regcache *regcache, int regno)
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))
@ -167,7 +167,7 @@ store_register (const struct regcache *regcache, int regno)
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];
@ -416,7 +416,7 @@ m68k_linux_nat_target::fetch_registers (struct regcache *regcache, int 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
@ -469,7 +469,7 @@ m68k_linux_nat_target::store_registers (struct regcache *regcache, int regno)
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

View File

@ -63,7 +63,7 @@ getfpregs_supplies (struct gdbarch *gdbarch, int regnum)
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))
@ -94,7 +94,7 @@ mips_fbsd_nat_target::fetch_registers (struct regcache *regcache, int 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))

View File

@ -270,7 +270,7 @@ mips_linux_nat_target::mips64_regsets_fetch_registers
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))
{
@ -357,7 +357,7 @@ mips_linux_nat_target::mips64_regsets_store_registers
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))
{

View File

@ -49,7 +49,7 @@ getregs_supplies (struct gdbarch *gdbarch, int regno)
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))
@ -79,7 +79,7 @@ mips_nbsd_nat_target::fetch_registers (struct regcache *regcache, int 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))

View File

@ -89,7 +89,7 @@ void
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) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
@ -104,7 +104,7 @@ static void
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) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));

View File

@ -917,7 +917,7 @@ nto_procfs_target::fetch_registers (struct regcache *regcache, int regno)
reg;
int regsize;
procfs_set_thread (regcache_get_ptid (regcache));
procfs_set_thread (regcache->ptid ());
if (devctl (ctl_fd, DCMD_PROC_GETGREG, &reg, sizeof (reg), &regsize) == EOK)
nto_supply_gregset (regcache, (char *) &reg.greg);
if (devctl (ctl_fd, DCMD_PROC_GETFPREG, &reg, sizeof (reg), &regsize)
@ -1393,7 +1393,7 @@ nto_procfs_target::store_registers (struct regcache *regcache, int regno)
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;

View File

@ -127,7 +127,7 @@ void
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) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
@ -153,7 +153,7 @@ void
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) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));

View File

@ -773,7 +773,7 @@ fetch_ppc_registers (struct regcache *regcache, int tid)
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);
@ -2131,7 +2131,7 @@ ppc_linux_nat_target::masked_watch_num_registers (CORE_ADDR addr, CORE_ADDR mask
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);

View File

@ -88,7 +88,7 @@ void
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))
{
@ -117,7 +117,7 @@ void
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))
{

View File

@ -82,7 +82,7 @@ void
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) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
@ -116,7 +116,7 @@ void
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) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));

View File

@ -2063,7 +2063,7 @@ procfs_target::fetch_registers (struct regcache *regcache, int regnum)
{
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 ();
@ -2112,7 +2112,7 @@ procfs_target::store_registers (struct regcache *regcache, int regnum)
{
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 ();

View File

@ -416,7 +416,7 @@ void
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)
@ -437,7 +437,7 @@ ravenscar_thread_target::store_registers (struct regcache *regcache,
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)
@ -457,7 +457,7 @@ void
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)

View File

@ -1536,7 +1536,7 @@ record_btrace_target::fetch_registers (struct regcache *regcache, int regno)
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;
@ -1572,7 +1572,7 @@ record_btrace_target::store_registers (struct regcache *regcache, int regno)
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);
@ -1586,7 +1586,7 @@ void
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);

View File

@ -223,16 +223,6 @@ reg_buffer::arch () const
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

View File

@ -35,10 +35,6 @@ extern struct regcache *get_thread_arch_aspace_regcache (ptid_t,
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);
@ -357,8 +353,12 @@ public:
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;
}

View File

@ -469,7 +469,7 @@ void
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);
@ -538,7 +538,7 @@ void
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);

View File

@ -8281,7 +8281,7 @@ remote_target::fetch_registers (struct regcache *regcache, int regnum)
int i;
set_remote_traceframe ();
set_general_thread (regcache_get_ptid (regcache));
set_general_thread (regcache->ptid ());
if (regnum >= 0)
{
@ -8438,7 +8438,7 @@ remote_target::store_registers (struct regcache *regcache, int regnum)
int i;
set_remote_traceframe ();
set_general_thread (regcache_get_ptid (regcache));
set_general_thread (regcache->ptid ());
if (regnum >= 0)
{

View File

@ -191,7 +191,7 @@ fetch_register (struct regcache *regcache, int regno)
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;
@ -250,7 +250,7 @@ store_register (struct regcache *regcache, int regno)
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);

View File

@ -408,7 +408,7 @@ check_regset (int tid, int regset, int regsize)
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);
@ -462,7 +462,7 @@ s390_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
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);

View File

@ -51,7 +51,7 @@ static sh_nbsd_nat_target the_sh_nbsd_nat_target;
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))
{
@ -73,7 +73,7 @@ sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int 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))
{

View File

@ -488,7 +488,7 @@ sol_thread_target::fetch_registers (struct regcache *regcache, int regnum)
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))
{
@ -540,7 +540,7 @@ sol_thread_target::store_registers (struct regcache *regcache, int regnum)
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))
{

View File

@ -152,7 +152,7 @@ sparc_fetch_inferior_registers (struct regcache *regcache, int regnum)
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)
{
@ -193,7 +193,7 @@ sparc_store_inferior_registers (struct regcache *regcache, int 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))
{

View File

@ -516,7 +516,7 @@ spu_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
/* Since we use functions that rely on inferior_ptid, we need to set and
restore it. */
scoped_restore save_ptid
= make_scoped_restore (&inferior_ptid, regcache_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))
@ -567,7 +567,7 @@ spu_linux_nat_target::store_registers (struct regcache *regcache, int regno)
/* Since we use functions that rely on inferior_ptid, we need to set and
restore it. */
scoped_restore save_ptid
= make_scoped_restore (&inferior_ptid, regcache_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))

View File

@ -189,7 +189,7 @@ spu_multiarch_target::fetch_registers (struct regcache *regcache, int regno)
/* Since we use functions that rely on inferior_ptid, we need to set and
restore it. */
scoped_restore save_ptid
= make_scoped_restore (&inferior_ptid, regcache_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)
@ -248,7 +248,7 @@ spu_multiarch_target::store_registers (struct regcache *regcache, int regno)
/* Since we use functions that rely on inferior_ptid, we need to set and
restore it. */
scoped_restore save_ptid
= make_scoped_restore (&inferior_ptid, regcache_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)

View File

@ -137,7 +137,7 @@ tilegx_linux_nat_target::fetch_registers (struct regcache *regcache,
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) &regs) < 0)
perror_with_name (_("Couldn't get registers"));
@ -153,7 +153,7 @@ tilegx_linux_nat_target::store_registers (struct regcache *regcache,
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) &regs) < 0)
perror_with_name (_("Couldn't get registers"));

View File

@ -74,7 +74,7 @@ void
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) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
@ -89,7 +89,7 @@ void
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) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers"));

View File

@ -582,7 +582,7 @@ do_windows_fetch_inferior_registers (struct regcache *regcache,
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
@ -611,7 +611,7 @@ do_windows_store_inferior_registers (const struct regcache *regcache,
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

View File

@ -220,7 +220,7 @@ supply_fpregset (struct regcache *regcache,
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;
@ -239,7 +239,7 @@ fetch_gregs (struct regcache *regcache, int regnum)
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;
@ -267,7 +267,7 @@ static int xtreg_high;
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];
@ -283,7 +283,7 @@ fetch_xtregs (struct regcache *regcache, int regnum)
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];