]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove regcache_get_ptid
authorSimon Marchi <simon.marchi@ericsson.com>
Wed, 30 May 2018 18:54:34 +0000 (14:54 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Wed, 30 May 2018 18:54:34 +0000 (14:54 -0400)
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.

50 files changed:
gdb/ChangeLog
gdb/aarch64-fbsd-nat.c
gdb/aarch64-linux-nat.c
gdb/aix-thread.c
gdb/alpha-bsd-nat.c
gdb/amd64-bsd-nat.c
gdb/amd64-linux-nat.c
gdb/arm-fbsd-nat.c
gdb/arm-linux-nat.c
gdb/arm-nbsd-nat.c
gdb/bsd-uthread.c
gdb/hppa-linux-nat.c
gdb/hppa-nbsd-nat.c
gdb/hppa-obsd-nat.c
gdb/i386-bsd-nat.c
gdb/i386-darwin-nat.c
gdb/i386-gnu-nat.c
gdb/i386-linux-nat.c
gdb/ia64-linux-nat.c
gdb/linux-nat-trad.c
gdb/m32r-linux-nat.c
gdb/m68k-bsd-nat.c
gdb/m68k-linux-nat.c
gdb/mips-fbsd-nat.c
gdb/mips-linux-nat.c
gdb/mips-nbsd-nat.c
gdb/mips64-obsd-nat.c
gdb/nto-procfs.c
gdb/ppc-fbsd-nat.c
gdb/ppc-linux-nat.c
gdb/ppc-nbsd-nat.c
gdb/ppc-obsd-nat.c
gdb/procfs.c
gdb/ravenscar-thread.c
gdb/record-btrace.c
gdb/regcache.c
gdb/regcache.h
gdb/remote-sim.c
gdb/remote.c
gdb/rs6000-nat.c
gdb/s390-linux-nat.c
gdb/sh-nbsd-nat.c
gdb/sol-thread.c
gdb/sparc-nat.c
gdb/spu-linux-nat.c
gdb/spu-multiarch.c
gdb/tilegx-linux-nat.c
gdb/vax-bsd-nat.c
gdb/windows-nat.c
gdb/xtensa-linux-nat.c

index 634207bdbfbca8eb54e68d9a26123ae630d99607..1c09d21729dbeaed33e9d0463a232824de28db2b 100644 (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.
index a50656353cdffe2ef7ecf1d29d6038ff7b4479d3..2d0da7fd39e4dd32905b64bb0c702c51901a9cbb 100644 (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))
index 908b83a49a89045ed33e6b978b1497d13bcdead7..3672a2f5ce5cceebbf1c5aa40822a71df5d8909a 100644 (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;
 
index d328bdd872ae0ba9af10eab3c0ada90fd68badc0..6f4135b8466c7aba99e7aaf691d0845caeef2b95 100644 (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;
 
index 77271ec6f73932ce089e2729e8349929c3671e37..e889d22f3331ce59782b548995ad7e4ab2170a09 100644 (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"));
     }
index 74a1842de9fe3573da3fd02a2bf0655f8318aff0..81ba835fc4963f507436e4340fe8c123a7077718 100644 (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))
     {
index 1cb4c2c627f23f4911e834e12ed0a3e315bc953a..17de388a2fbc193101c1f646891b645fd7e7a792 100644 (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))
     {
index be733ff7467a2c2f3fcde03d7e1afe3a7acef78e..34b13354f32011fbca20afce3e2903c88aa7c58d 100644 (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))
index 30030b4eb06019b05a2adc8cf0297139f80c9816..ccf812b21b116d8baf7e9c4810bd1e693ed322cf 100644 (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)
     {
index 3a1ddeaf4e859f68f9f06a0288420e8123f67a94..3d64346008f5c06445e4e6dcfa5bd1686ec6af4d 100644 (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)
index 1505cfede70541ab9b777b4401a05fdb45c46013..9ead7c2b3dee60def279ea1776a43f51ecd6b963 100644 (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);
index bc6c234d513773f767d841bc35e36f8542321dc5..39ae83fe6aeec2337356ff93dfcd9b16eac6b973 100644 (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);
index 3547d655437ea75d231f86b48f1b735acee96930..2ffa5bc79fc45fefeb47595259536a179ee6f7ff 100644 (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))
     {
index 43c2dcc2b84da634de6d57d2c4c5e3ad3f92a082..2ef2f7ef2cf41c992e7aaa791a28eac2196e2e46 100644 (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))
     {
index f7f27ceba0ba5cccd56d89a754c1d300cc168f9e..cca46298435111407445cd380fc21142e3254239 100644 (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))
     {
index e57b12693f029b4606e3056e04b295d098a93543..03adb20e989256aefeb3a34662e2b54e42e5fa66 100644 (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
index 8bb036dac3d93d52adbcf909b95d0282530181e9..e5195f3eb6e09c744ebd033fe66a29bad3a492d6 100644 (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);
index 653832430610adb2cf61a13573c3750bd1720ab2..054638ba1f0f8c5dc41ee1964ffac5d562bd35ec 100644 (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
index f73e17ac765f3ef316a4b5e8472b2b0aedfc415b..d095bde2ffb39a418bb27b563aa07a5d84f6f3e4 100644 (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);
index ce6788c0bc1cda25025d007c65e5fdcd1d54c00a..ed75eeda82c2ca748ef79f87fb75b1a58558fc10 100644 (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);
index 09a019a7b1082c217720576d218c81a589c89221..9d833fa19ecde24d6e4466f028713427b6ee4b0c 100644 (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.  */
index af907adb78a1be10fb9b744b12d6634d756e1447..c44f736328ebcccacf8ff1a354178b4df1a3402e 100644 (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))
     {
index e25154cdd7025d3deafd9c0faf870e03e4a048df..409a4fd09d3676fc982dc3da6d54e5b67d97ff05 100644 (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
index 04fbb2ad1a7d23a929d5f2fd3933c983368bfaa3..7761301b6f58a9bd7fe4055c7bc6bd531fc33750 100644 (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))
index 36831071fbc493554f243a5be83f898714a0f69f..beb0ea0a26a1c489265f01a41e2fcf79971a6e34 100644 (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))
     {
index b9fc6279d095b98640e6aa2f4e45e9f686d3d632..4c61081a3892190925965f9e5c8a483d5711a9f8 100644 (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))
index 7f14b09108b263e40c9f8cde0588795697605504..27e1ab6750acf405d01deff0256d671dc03929cb 100644 (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"));
index f0ef9b9eb4cf9b9284df2ae006bfdab494a0497f..fcd30016f2cf2c7e64bba892c6aedbf54170e021 100644 (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;
index 6ca4bbac39324ed8fb5c346f19934d3b3618a5ab..89a7e6eb5c23c9919629c301263e7b77167e4cac 100644 (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"));
index eb21f91c1329ef0ee8244f3881e1b725e4053d64..7606081f22a75d29bb86c68a7afa2a8e4f28c5aa 100644 (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);
index f6e3884a3d5cca6ed9bb7586cb6c390d5204967b..037b261331ff17c573c5208fbf2e896b0198a734 100644 (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))
     {
index 4428dabd7b935edf01e82f8dcddc1d98928790e9..88ba0c5c736d702c72df4c7d5084c4ee9237c8f2 100644 (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"));
index 70619f1c157eba173d302c01e12e3c43f3521279..e01d6647e1c37145362ca0a01e1f2e87973c1ed3 100644 (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 ();
index 5f3e179deca76292dd565dffc0a7f5d8e47eca46..b8630c3f3a185778f2dbe133557b2087015c1ad7 100644 (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)
index 0f01aceb93c7206fff1d7da353d3dc4b416fc360..35c8421525ff7f0f75a3e13a7b719d7ef0d60b01 100644 (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);
index 83bcbd22a374060d9bf995316abed2a4c76288fa..9881e92468ddce3c3ca5eea97872df26cda4bd93 100644 (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
index d7bb8b5c932a6447d4a7d3d93f211a019a6bf004..7fcc43a83c56c05d95eec55c029a5b4504ac3477 100644 (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;
   }
 
index 5fd24cbdb1ab3ea4d62fe5e9658901ca9567c32c..9c89ab9db729d66be699e548d66beedd17855ab0 100644 (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);
 
index e7ade41c3407b0ed88d93cc59dbaeef847068cd4..3df9ad4fbe35f22da20acb96461e4dded8d49509 100644 (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)
     {
index e9f064710add8490481bf29bac3d9b6679e9ba20..689d8e815c69b6eacce00119505a3488e2de7450 100644 (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);
index 3c65c5eaa5c2450470fde1404ad6e61ea3d1593b..abb06a9901bb535cedac04d95c07acd40add0703 100644 (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);
index 6bd089e32b31f332ccaec8a958734498fbb4cd19..062b5220ffa4d8c91ec2c4461763bee58bb1ef22 100644 (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))
     {
index 22dd8d6eaab403c1fa07dcc4903f6bddb131f5a5..1023f7d17c770aa10574a34295309e17c173b807 100644 (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))
     {
index 8b5c68619de7f3caf48300954a6239839066211c..86a6b5a20a9476bbfa590ff3dcdea93cd26b1e75 100644 (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))
     {
index 45485b58efbacc5b59629e2850df0c2c9079d15f..81bb5dd25f3c4dfd67af490a80b1e94223e49ad1 100644 (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))
index 5da5e4e7fcdaded5ea207273a1aab3dbc2fb6dd8..4a4d500b3bff2f060c4bf9d84d6fb1c38d0d0ccc 100644 (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)
index 753d81859d61f1f8eeaaf1645a308dbfd7c531cc..9b596c03424fe9b2ea09cce5678816f3c31c2a8b 100644 (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"));
index 7f7b54a84125701a4254dbfbded66b8b6656ddc2..5f67061e05ae9b3022058a7941e76b88f4a01166 100644 (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"));
index 608356e74b9a2a6268aac7bccd2baaf80de7e265..3fd8415bfcdc5f6b11716e9795712d2e83ccfbb7 100644 (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
index 8d9659b7f98c0f2f4b5641b230abc8a4c91db829..57a44e302370ec97bab262da85dfdabfe3f0dcb6 100644 (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];