Reading signal handler frame in AIX
[deliverable/binutils-gdb.git] / gdb / sol-thread.c
index c5540577f0d4e0447e1789a13c8414a683b8bcee..682302a40bebf71195621cacb64ff0533c62d892 100644 (file)
@@ -300,12 +300,12 @@ thread_to_lwp (ptid_t thread_id, int default_lwp)
   td_thrhandle_t th;
   td_err_e val;
 
-  if (ptid_lwp_p (thread_id))
+  if (thread_id.lwp_p ())
     return thread_id;          /* It's already an LWP ID.  */
 
   /* It's a thread.  Convert to LWP.  */
 
-  val = p_td_ta_map_id2thr (main_ta, ptid_get_tid (thread_id), &th);
+  val = p_td_ta_map_id2thr (main_ta, thread_id.tid (), &th);
   if (val == TD_NOTHR)
     return ptid_t (-1);        /* Thread must have terminated.  */
   else if (val != TD_OK)
@@ -340,7 +340,7 @@ lwp_to_thread (ptid_t lwp)
   td_thrhandle_t th;
   td_err_e val;
 
-  if (ptid_tid_p (lwp))
+  if (lwp.tid_p ())
     return lwp;                        /* It's already a thread ID.  */
 
   /* It's an LWP.  Convert it to a thread ID.  */
@@ -415,7 +415,7 @@ sol_thread_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
        error (_("This version of Solaris can't start inactive threads."));
       if (info_verbose && ptid.pid () == -1)
        warning (_("Specified thread %ld seems to have terminated"),
-                ptid_get_tid (save_ptid));
+                save_ptid.tid ());
     }
 
   beneath ()->resume (ptid, step, signo);
@@ -440,14 +440,14 @@ sol_thread_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
 
   if (ptid.pid () != -1)
     {
-      ptid_t save_ptid = ptid;
+      ptid_t ptid_for_warning = ptid;
 
       ptid = thread_to_lwp (ptid, -2);
       if (ptid.pid () == -2)           /* Inactive thread.  */
        error (_("This version of Solaris can't start inactive threads."));
       if (info_verbose && ptid.pid () == -1)
        warning (_("Specified thread %ld seems to have terminated"),
-                ptid_get_tid (save_ptid));
+                ptid_for_warning.tid ());
     }
 
   rtnval = beneath ()->wait (ptid, ourstatus, options);
@@ -460,8 +460,8 @@ sol_thread_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
        rtnval = save_ptid;
 
       /* See if we have a new thread.  */
-      if (ptid_tid_p (rtnval)
-         && !ptid_equal (rtnval, save_ptid)
+      if (rtnval.tid_p ()
+         && rtnval != save_ptid
          && (!in_thread_list (rtnval)
              || is_exited (rtnval)))
        add_thread (rtnval);
@@ -486,7 +486,7 @@ sol_thread_target::fetch_registers (struct regcache *regcache, int regnum)
   gdb_fpregset_t *fpregset_p = &fpregset;
   ptid_t ptid = regcache->ptid ();
 
-  if (!ptid_tid_p (ptid))
+  if (!ptid.tid_p ())
     {
       /* It's an LWP; pass the request on to the layer beneath.  */
       beneath ()->fetch_registers (regcache, regnum);
@@ -494,7 +494,7 @@ sol_thread_target::fetch_registers (struct regcache *regcache, int regnum)
     }
 
   /* Solaris thread: convert PTID into a td_thrhandle_t.  */
-  thread = ptid_get_tid (ptid);
+  thread = ptid.tid ();
   if (thread == 0)
     error (_("sol_thread_fetch_registers: thread == 0"));
 
@@ -538,7 +538,7 @@ sol_thread_target::store_registers (struct regcache *regcache, int regnum)
   prfpregset_t fpregset;
   ptid_t ptid = regcache->ptid ();
 
-  if (!ptid_tid_p (ptid))
+  if (!ptid.tid_p ())
     {
       /* It's an LWP; pass the request on to the layer beneath.  */
       beneath ()->store_registers (regcache, regnum);
@@ -546,7 +546,7 @@ sol_thread_target::store_registers (struct regcache *regcache, int regnum)
     }
 
   /* Solaris thread: convert PTID into a td_thrhandle_t.  */
-  thread = ptid_get_tid (ptid);
+  thread = ptid.tid ();
 
   val = p_td_ta_map_id2thr (main_ta, thread, &thandle);
   if (val != TD_OK)
@@ -591,7 +591,7 @@ sol_thread_target::xfer_partial (enum target_object object,
 {
   scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
 
-  if (ptid_tid_p (inferior_ptid) || !target_thread_alive (inferior_ptid))
+  if (inferior_ptid.tid_p () || !target_thread_alive (inferior_ptid))
     {
       /* It's either a thread or an LWP that isn't alive.  Any live
          LWP will do so use the first available.
@@ -697,17 +697,19 @@ sol_thread_target::mourn_inferior ()
 bool
 sol_thread_target::thread_alive (ptid_t ptid)
 {
-  if (ptid_tid_p (ptid))
+  if (ptid.tid_p ())
     {
       /* It's a (user-level) thread.  */
       td_err_e val;
       td_thrhandle_t th;
       int pid;
 
-      pid = ptid_get_tid (ptid);
-      if ((val = p_td_ta_map_id2thr (main_ta, pid, &th)) != TD_OK)
+      pid = ptid.tid ();
+      val = p_td_ta_map_id2thr (main_ta, pid, &th);
+      if (val != TD_OK)
        return false;           /* Thread not found.  */
-      if ((val = p_td_thr_validate (&th)) != TD_OK)
+      val = p_td_thr_validate (&th);
+      if (val != TD_OK)
        return false;           /* Thread not valid.  */
       return true;             /* Known thread.  */
     }
@@ -785,7 +787,7 @@ rw_common (int dowrite, const struct ps_prochandle *ph, psaddr_t addr,
 
   scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
 
-  if (ptid_tid_p (inferior_ptid) || !target_thread_alive (inferior_ptid))
+  if (inferior_ptid.tid_p () || !target_thread_alive (inferior_ptid))
     {
       /* It's either a thread or an LWP that isn't alive.  Any live
          LWP will do so use the first available.
@@ -943,7 +945,6 @@ ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid,
   return PS_OK;
 }
 
-#ifdef PR_MODEL_LP64
 /* Identify process as 32-bit or 64-bit.  At the moment we're using
    BFD to do this.  There might be a more Solaris-specific
    (e.g. procfs) method, but this ought to work.  */
@@ -960,7 +961,6 @@ ps_pdmodel (struct ps_prochandle *ph, int *data_model)
 
   return PS_OK;
 }
-#endif /* PR_MODEL_LP64 */
 
 #if (defined(__i386__) || defined(__x86_64__)) && defined (sun)
 
@@ -970,8 +970,7 @@ ps_pdmodel (struct ps_prochandle *ph, int *data_model)
    of libthread_db would fail because of ps_lgetLDT being undefined.  */
 
 ps_err_e
-ps_lgetLDT (struct ps_prochandle *ph, lwpid_t lwpid,
-           struct ssd *pldt)
+ps_lgetLDT (struct ps_prochandle *ph, lwpid_t lwpid, struct ssd *pldt) /* ARI: editCase function */
 {
   /* NOTE: only used on Solaris, therefore OK to refer to procfs.c.  */
   struct ssd *ret;
@@ -1003,7 +1002,7 @@ sol_thread_target::pid_to_str (ptid_t ptid)
 {
   static char buf[100];
 
-  if (ptid_tid_p (ptid))
+  if (ptid.tid_p ())
     {
       ptid_t lwp;
 
@@ -1011,13 +1010,13 @@ sol_thread_target::pid_to_str (ptid_t ptid)
 
       if (lwp.pid () == -1)
        xsnprintf (buf, sizeof (buf), "Thread %ld (defunct)",
-                  ptid_get_tid (ptid));
+                  ptid.tid ());
       else if (lwp.pid () != -2)
        xsnprintf (buf, sizeof (buf), "Thread %ld (LWP %ld)",
-                ptid_get_tid (ptid), lwp.lwp ());
+                ptid.tid (), lwp.lwp ());
       else
        xsnprintf (buf, sizeof (buf), "Thread %ld        ",
-                  ptid_get_tid (ptid));
+                  ptid.tid ());
     }
   else if (ptid.lwp () != 0)
     xsnprintf (buf, sizeof (buf), "LWP    %ld        ", ptid.lwp ());
@@ -1157,7 +1156,7 @@ thread_db_find_thread_from_tid (struct thread_info *thread, void *data)
 {
   long *tid = (long *) data;
 
-  if (ptid_get_tid (thread->ptid) == *tid)
+  if (thread->ptid.tid () == *tid)
     return 1;
 
   return 0;
This page took 0.027518 seconds and 4 git commands to generate.