]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/linux-thread-db.c
Remove ptid_get_pid
[thirdparty/binutils-gdb.git] / gdb / linux-thread-db.c
index b67bd5d00dca56e05202b1232e216f12782c0935..11c07dc2df0d57011ab255bd864ea84198b22c03 100644 (file)
@@ -230,7 +230,7 @@ add_thread_db_info (void *handle)
 {
   struct thread_db_info *info = XCNEW (struct thread_db_info);
 
-  info->pid = ptid_get_pid (inferior_ptid);
+  info->pid = inferior_ptid.pid ();
   info->handle = handle;
 
   /* The workaround works by reading from /proc/pid/status, so it is
@@ -396,7 +396,7 @@ thread_from_lwp (thread_info *stopped, ptid_t ptid)
      LWP.  */
   gdb_assert (ptid_get_lwp (ptid) != 0);
 
-  info = get_thread_db_info (ptid_get_pid (ptid));
+  info = get_thread_db_info (ptid.pid ());
 
   /* Access an lwp we know is stopped.  */
   info->proc_handle.thread = stopped;
@@ -424,7 +424,7 @@ thread_db_notice_clone (ptid_t parent, ptid_t child)
 {
   struct thread_db_info *info;
 
-  info = get_thread_db_info (ptid_get_pid (child));
+  info = get_thread_db_info (child.pid ());
 
   if (info == NULL)
     return 0;
@@ -871,7 +871,7 @@ try_thread_db_load_1 (struct thread_db_info *info)
      td_ta_map_lwp2thr uses ps_get_thread_area, but we can't use that
      currently on core targets, as it uses ptrace directly.  */
   if (target_has_execution
-      && linux_proc_task_list_dir_exists (ptid_get_pid (inferior_ptid)))
+      && linux_proc_task_list_dir_exists (inferior_ptid.pid ()))
     info->td_ta_thr_iter_p = NULL;
   else
     CHK (TDB_VERBOSE_DLSYM (info, td_ta_thr_iter));
@@ -890,13 +890,13 @@ try_thread_db_load_1 (struct thread_db_info *info)
   if (info->td_ta_thr_iter_p == NULL)
     {
       struct lwp_info *lp;
-      int pid = ptid_get_pid (inferior_ptid);
+      int pid = inferior_ptid.pid ();
       thread_info *curr_thread = inferior_thread ();
 
       linux_stop_and_wait_all_lwps ();
 
       ALL_LWPS (lp)
-       if (ptid_get_pid (lp->ptid) == pid)
+       if (lp->ptid.pid () == pid)
          thread_from_lwp (curr_thread, lp->ptid);
 
       linux_unstop_all_lwps ();
@@ -1003,7 +1003,7 @@ try_thread_db_load (const char *library, int check_auto_load_safe)
     return 1;
 
   /* This library "refused" to work on current inferior.  */
-  delete_thread_db_info (ptid_get_pid (inferior_ptid));
+  delete_thread_db_info (inferior_ptid.pid ());
   return 0;
 }
 
@@ -1175,7 +1175,7 @@ thread_db_load (void)
 {
   struct thread_db_info *info;
 
-  info = get_thread_db_info (ptid_get_pid (inferior_ptid));
+  info = get_thread_db_info (inferior_ptid.pid ());
 
   if (info != NULL)
     return 1;
@@ -1284,7 +1284,7 @@ check_pid_namespace_match (void)
         child's thread list, we'll mistakenly think it has no threads
         since the thread PID fields won't match the PID we give to
         libthread_db.  */
-      if (!linux_ns_same (ptid_get_pid (inferior_ptid), LINUX_NS_PID))
+      if (!linux_ns_same (inferior_ptid.pid (), LINUX_NS_PID))
        {
          warning (_ ("Target and debugger are in different PID "
                      "namespaces; thread lists and other data are "
@@ -1384,7 +1384,7 @@ thread_db_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
       return ptid;
     }
 
-  info = get_thread_db_info (ptid_get_pid (ptid));
+  info = get_thread_db_info (ptid.pid ());
 
   /* If this process isn't using thread_db, we're done.  */
   if (info == NULL)
@@ -1394,7 +1394,7 @@ thread_db_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
     {
       /* New image, it may or may not end up using thread_db.  Assume
         not unless we find otherwise.  */
-      delete_thread_db_info (ptid_get_pid (ptid));
+      delete_thread_db_info (ptid.pid ());
       if (!thread_db_list)
        unpush_target (&the_thread_db_target);
 
@@ -1410,7 +1410,7 @@ thread_db_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
 void
 thread_db_target::mourn_inferior ()
 {
-  delete_thread_db_info (ptid_get_pid (inferior_ptid));
+  delete_thread_db_info (inferior_ptid.pid ());
 
   beneath ()->mourn_inferior ();
 
@@ -1716,7 +1716,7 @@ thread_db_target::get_thread_local_address (ptid_t ptid,
     {
       td_err_e err;
       psaddr_t address;
-      thread_db_info *info = get_thread_db_info (ptid_get_pid (ptid));
+      thread_db_info *info = get_thread_db_info (ptid.pid ());
       thread_db_thread_info *priv = get_thread_db_thread_info (thread_info);
 
       /* Finally, get the address of the variable.  */
@@ -1784,7 +1784,7 @@ ptid_t
 thread_db_target::get_ada_task_ptid (long lwp, long thread)
 {
   /* NPTL uses a 1:1 model, so the LWP id suffices.  */
-  return ptid_t (ptid_get_pid (inferior_ptid), lwp, 0);
+  return ptid_t (inferior_ptid.pid (), lwp, 0);
 }
 
 void
@@ -1793,9 +1793,9 @@ thread_db_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
   struct thread_db_info *info;
 
   if (ptid_equal (ptid, minus_one_ptid))
-    info = get_thread_db_info (ptid_get_pid (inferior_ptid));
+    info = get_thread_db_info (inferior_ptid.pid ());
   else
-    info = get_thread_db_info (ptid_get_pid (ptid));
+    info = get_thread_db_info (ptid.pid ());
 
   /* This workaround is only needed for child fork lwps stopped in a
      PTRACE_O_TRACEFORK event.  When the inferior is resumed, the
@@ -1923,7 +1923,7 @@ info_auto_load_libthread_db (const char *args, int from_tty)
 static void
 maintenance_check_libthread_db (const char *args, int from_tty)
 {
-  int inferior_pid = ptid_get_pid (inferior_ptid);
+  int inferior_pid = inferior_ptid.pid ();
   struct thread_db_info *info;
 
   if (inferior_pid == 0)