Remove ptid_get_lwp
[deliverable/binutils-gdb.git] / gdb / ppc-linux-nat.c
index eb21f91c1329ef0ee8244f3881e1b725e4053d64..9719a0e906deea71f5042a60e16c1eb90fb271b7 100644 (file)
@@ -512,22 +512,20 @@ fetch_spe_register (struct regcache *regcache, int tid, int regno)
       int i;
 
       for (i = 0; i < ppc_num_gprs; i++)
-        regcache_raw_supply (regcache, tdep->ppc_ev0_upper_regnum + i,
-                             &evrregs.evr[i]);
+        regcache->raw_supply (tdep->ppc_ev0_upper_regnum + i, &evrregs.evr[i]);
     }
   else if (tdep->ppc_ev0_upper_regnum <= regno
            && regno < tdep->ppc_ev0_upper_regnum + ppc_num_gprs)
-    regcache_raw_supply (regcache, regno,
-                         &evrregs.evr[regno - tdep->ppc_ev0_upper_regnum]);
+    regcache->raw_supply (regno,
+                         &evrregs.evr[regno - tdep->ppc_ev0_upper_regnum]);
 
   if (regno == -1
       || regno == tdep->ppc_acc_regnum)
-    regcache_raw_supply (regcache, tdep->ppc_acc_regnum, &evrregs.acc);
+    regcache->raw_supply (tdep->ppc_acc_regnum, &evrregs.acc);
 
   if (regno == -1
       || regno == tdep->ppc_spefscr_regnum)
-    regcache_raw_supply (regcache, tdep->ppc_spefscr_regnum,
-                         &evrregs.spefscr);
+    regcache->raw_supply (tdep->ppc_spefscr_regnum, &evrregs.spefscr);
 }
 
 static void
@@ -573,7 +571,7 @@ fetch_register (struct regcache *regcache, int tid, int regno)
   if (regaddr == -1)
     {
       memset (buf, '\0', register_size (gdbarch, regno));   /* Supply zeroes */
-      regcache_raw_supply (regcache, regno, buf);
+      regcache->raw_supply (regno, buf);
       return;
     }
 
@@ -606,14 +604,14 @@ fetch_register (struct regcache *regcache, int tid, int regno)
     {
       /* Little-endian values are always found at the left end of the
          bytes transferred.  */
-      regcache_raw_supply (regcache, regno, buf);
+      regcache->raw_supply (regno, buf);
     }
   else if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
     {
       /* Big-endian values are found at the right end of the bytes
          transferred.  */
       size_t padding = (bytes_transferred - register_size (gdbarch, regno));
-      regcache_raw_supply (regcache, regno, buf + padding);
+      regcache->raw_supply (regno, buf + padding);
     }
   else 
     internal_error (__FILE__, __LINE__,
@@ -773,7 +771,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);
@@ -897,26 +895,23 @@ store_spe_register (const struct regcache *regcache, int tid, int regno)
       int i;
 
       for (i = 0; i < ppc_num_gprs; i++)
-        regcache_raw_collect (regcache,
-                              tdep->ppc_ev0_upper_regnum + i,
-                              &evrregs.evr[i]);
+       regcache->raw_collect (tdep->ppc_ev0_upper_regnum + i,
+                              &evrregs.evr[i]);
     }
   else if (tdep->ppc_ev0_upper_regnum <= regno
            && regno < tdep->ppc_ev0_upper_regnum + ppc_num_gprs)
-    regcache_raw_collect (regcache, regno,
-                          &evrregs.evr[regno - tdep->ppc_ev0_upper_regnum]);
+    regcache->raw_collect (regno,
+                          &evrregs.evr[regno - tdep->ppc_ev0_upper_regnum]);
 
   if (regno == -1
       || regno == tdep->ppc_acc_regnum)
-    regcache_raw_collect (regcache,
-                          tdep->ppc_acc_regnum,
-                          &evrregs.acc);
+    regcache->raw_collect (tdep->ppc_acc_regnum,
+                          &evrregs.acc);
 
   if (regno == -1
       || regno == tdep->ppc_spefscr_regnum)
-    regcache_raw_collect (regcache,
-                          tdep->ppc_spefscr_regnum,
-                          &evrregs.spefscr);
+    regcache->raw_collect (tdep->ppc_spefscr_regnum,
+                          &evrregs.spefscr);
 
   /* Write back the modified register set.  */
   set_spe_registers (tid, &evrregs);
@@ -960,13 +955,13 @@ store_register (const struct regcache *regcache, int tid, int regno)
   if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
     {
       /* Little-endian values always sit at the left end of the buffer.  */
-      regcache_raw_collect (regcache, regno, buf);
+      regcache->raw_collect (regno, buf);
     }
   else if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
     {
       /* Big-endian values sit at the right end of the buffer.  */
       size_t padding = (bytes_to_transfer - register_size (gdbarch, regno));
-      regcache_raw_collect (regcache, regno, buf + padding);
+      regcache->raw_collect (regno, buf + padding);
     }
 
   for (i = 0; i < bytes_to_transfer; i += sizeof (long))
@@ -1170,7 +1165,7 @@ ppc_linux_get_hwcap (void)
 {
   CORE_ADDR field;
 
-  if (target_auxv_search (target_stack, AT_HWCAP, &field) != 1)
+  if (target_auxv_search (current_top_target (), AT_HWCAP, &field) != 1)
     return 0;
 
   return field;
@@ -1229,9 +1224,9 @@ have_ptrace_hwdebug_interface (void)
     {
       int tid;
 
-      tid = ptid_get_lwp (inferior_ptid);
+      tid = inferior_ptid.lwp ();
       if (tid == 0)
-       tid = ptid_get_pid (inferior_ptid);
+       tid = inferior_ptid.pid ();
 
       /* Check for kernel support for PowerPC HWDEBUG ptrace interface.  */
       if (ptrace (PPC_PTRACE_GETHWDBGINFO, tid, 0, &hwdebug_info) >= 0)
@@ -1301,9 +1296,9 @@ ppc_linux_nat_target::can_use_hw_breakpoint (enum bptype type, int cnt, int ot)
       /* We need to know whether ptrace supports PTRACE_SET_DEBUGREG
         and whether the target has DABR.  If either answer is no, the
         ptrace call will return -1.  Fail in that case.  */
-      tid = ptid_get_lwp (ptid);
+      tid = ptid.lwp ();
       if (tid == 0)
-       tid = ptid_get_pid (ptid);
+       tid = ptid.pid ();
 
       if (ptrace (PTRACE_SET_DEBUGREG, tid, 0, 0) == -1)
        return 0;
@@ -1513,7 +1508,7 @@ ppc_linux_nat_target::insert_hw_breakpoint (struct gdbarch *gdbarch,
     }
 
   ALL_LWPS (lp)
-    hwdebug_insert_point (&p, ptid_get_lwp (lp->ptid));
+    hwdebug_insert_point (&p, lp->ptid.lwp ());
 
   return 0;
 }
@@ -1549,7 +1544,7 @@ ppc_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch,
     }
 
   ALL_LWPS (lp)
-    hwdebug_remove_point (&p, ptid_get_lwp (lp->ptid));
+    hwdebug_remove_point (&p, lp->ptid.lwp ());
 
   return 0;
 }
@@ -1592,7 +1587,7 @@ ppc_linux_nat_target::insert_mask_watchpoint (CORE_ADDR addr,  CORE_ADDR mask,
   p.condition_value = 0;
 
   ALL_LWPS (lp)
-    hwdebug_insert_point (&p, ptid_get_lwp (lp->ptid));
+    hwdebug_insert_point (&p, lp->ptid.lwp ());
 
   return 0;
 }
@@ -1620,7 +1615,7 @@ ppc_linux_nat_target::remove_mask_watchpoint (CORE_ADDR addr, CORE_ADDR mask,
   p.condition_value = 0;
 
   ALL_LWPS (lp)
-    hwdebug_remove_point (&p, ptid_get_lwp (lp->ptid));
+    hwdebug_remove_point (&p, lp->ptid.lwp ());
 
   return 0;
 }
@@ -1630,7 +1625,7 @@ static int
 can_use_watchpoint_cond_accel (void)
 {
   struct thread_points *p;
-  int tid = ptid_get_lwp (inferior_ptid);
+  int tid = inferior_ptid.lwp ();
   int cnt = hwdebug_info.num_condition_regs, i;
   CORE_ADDR tmp_value;
 
@@ -1884,7 +1879,7 @@ ppc_linux_nat_target::insert_watchpoint (CORE_ADDR addr, int len,
       create_watchpoint_request (&p, addr, len, type, cond, 1);
 
       ALL_LWPS (lp)
-       hwdebug_insert_point (&p, ptid_get_lwp (lp->ptid));
+       hwdebug_insert_point (&p, lp->ptid.lwp ());
 
       ret = 0;
     }
@@ -1928,7 +1923,7 @@ ppc_linux_nat_target::insert_watchpoint (CORE_ADDR addr, int len,
       saved_dabr_value = dabr_value;
 
       ALL_LWPS (lp)
-       if (ptrace (PTRACE_SET_DEBUGREG, ptid_get_lwp (lp->ptid), 0,
+       if (ptrace (PTRACE_SET_DEBUGREG, lp->ptid.lwp (), 0,
                    saved_dabr_value) < 0)
          return -1;
 
@@ -1953,7 +1948,7 @@ ppc_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len,
       create_watchpoint_request (&p, addr, len, type, cond, 0);
 
       ALL_LWPS (lp)
-       hwdebug_remove_point (&p, ptid_get_lwp (lp->ptid));
+       hwdebug_remove_point (&p, lp->ptid.lwp ());
 
       ret = 0;
     }
@@ -1961,7 +1956,7 @@ ppc_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len,
     {
       saved_dabr_value = 0;
       ALL_LWPS (lp)
-       if (ptrace (PTRACE_SET_DEBUGREG, ptid_get_lwp (lp->ptid), 0,
+       if (ptrace (PTRACE_SET_DEBUGREG, lp->ptid.lwp (), 0,
                    saved_dabr_value) < 0)
          return -1;
 
@@ -1974,7 +1969,7 @@ ppc_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len,
 void
 ppc_linux_nat_target::low_new_thread (struct lwp_info *lp)
 {
-  int tid = ptid_get_lwp (lp->ptid);
+  int tid = lp->ptid.lwp ();
 
   if (have_ptrace_hwdebug_interface ())
     {
@@ -2013,7 +2008,7 @@ static void
 ppc_linux_thread_exit (struct thread_info *tp, int silent)
 {
   int i;
-  int tid = ptid_get_lwp (tp->ptid);
+  int tid = tp->ptid.lwp ();
   struct hw_break_tuple *hw_breaks;
   struct thread_points *t = NULL, *p;
 
@@ -2062,7 +2057,7 @@ ppc_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
       /* The index (or slot) of the *point is passed in the si_errno field.  */
       int slot = siginfo.si_errno;
 
-      t = hwdebug_find_thread_points_by_tid (ptid_get_lwp (inferior_ptid), 0);
+      t = hwdebug_find_thread_points_by_tid (inferior_ptid.lwp (), 0);
 
       /* Find out if this *point is a hardware breakpoint.
         If so, we should return 0.  */
@@ -2131,7 +2126,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);
@@ -2188,9 +2183,9 @@ ppc_linux_nat_target::auxv_parse (gdb_byte **readptr,
                                  gdb_byte *endptr, CORE_ADDR *typep,
                                  CORE_ADDR *valp)
 {
-  int tid = ptid_get_lwp (inferior_ptid);
+  int tid = inferior_ptid.lwp ();
   if (tid == 0)
-    tid = ptid_get_pid (inferior_ptid);
+    tid = inferior_ptid.pid ();
 
   int sizeof_auxv_field = ppc_linux_target_wordsize (tid);
 
@@ -2215,9 +2210,9 @@ ppc_linux_nat_target::auxv_parse (gdb_byte **readptr,
 const struct target_desc *
 ppc_linux_nat_target::read_description ()
 {
-  int tid = ptid_get_lwp (inferior_ptid);
+  int tid = inferior_ptid.lwp ();
   if (tid == 0)
-    tid = ptid_get_pid (inferior_ptid);
+    tid = inferior_ptid.pid ();
 
   if (have_ptrace_getsetevrregs)
     {
This page took 0.031029 seconds and 4 git commands to generate.