Patchwork [RFA,01/10] Remove ptid_build

login
register
mail settings
Submitter Tom Tromey
Date June 13, 2018, 9:50 p.m.
Message ID <20180613215049.9691-2-tom@tromey.com>
Download mbox | patch
Permalink /patch/27818/
State New
Headers show

Comments

Tom Tromey - June 13, 2018, 9:50 p.m.
This removes ptid_build in favor of simply calling the ptid_t
constructor directly.

ChangeLog
2018-06-13  Tom Tromey  <tom@tromey.com>

	* common/ptid.h (ptid_build): Don't declare.
	* common/ptid.c (ptid_build): Remove.
	* aix-thread.c: Update.
	* bsd-kvm.c: Update.
	* bsd-uthread.c: Update.
	* common/agent.c: Update.
	* common/ptid.c: Update.
	* common/ptid.h: Update.
	* corelow.c: Update.
	* darwin-nat.c: Update.
	* fbsd-nat.c: Update.
	* gnu-nat.c: Update.
	* linux-fork.c: Update.
	* linux-nat.c: Update.
	* linux-thread-db.c: Update.
	* nat/linux-osdata.c: Update.
	* nat/linux-procfs.c: Update.
	* nto-procfs.c: Update.
	* obsd-nat.c: Update.
	* proc-service.c: Update.
	* procfs.c: Update.
	* ravenscar-thread.c: Update.
	* remote-sim.c: Update.
	* remote.c: Update.
	* sol-thread.c: Update.
	* target.c: Update.
	* windows-nat.c: Update.

gdbserver/ChangeLog
2018-06-13  Tom Tromey  <tom@tromey.com>

	* linux-low.c: Update.
	* lynx-low.c: Update.
	* nto-low.c: Update.
	* remote-utils.c: Update.
	* spu-low.c: Update.
	* thread-db.c: Update.
	* win32-low.c: Update.
---
 gdb/ChangeLog                | 30 ++++++++++++++++++++++++++++++
 gdb/aix-thread.c             |  4 ++--
 gdb/bsd-kvm.c                |  2 +-
 gdb/bsd-uthread.c            |  4 ++--
 gdb/common/agent.c           |  2 +-
 gdb/common/ptid.c            |  8 --------
 gdb/common/ptid.h            |  4 ----
 gdb/corelow.c                |  2 +-
 gdb/darwin-nat.c             | 18 +++++++++---------
 gdb/fbsd-nat.c               |  6 +++---
 gdb/gdbserver/ChangeLog      | 10 ++++++++++
 gdb/gdbserver/linux-low.c    | 12 ++++++------
 gdb/gdbserver/lynx-low.c     | 16 ++++++++--------
 gdb/gdbserver/nto-low.c      | 10 +++++-----
 gdb/gdbserver/remote-utils.c |  4 ++--
 gdb/gdbserver/spu-low.c      |  8 ++++----
 gdb/gdbserver/thread-db.c    |  2 +-
 gdb/gdbserver/win32-low.c    |  4 ++--
 gdb/gnu-nat.c                | 10 +++++-----
 gdb/linux-fork.c             |  2 +-
 gdb/linux-nat.c              | 22 +++++++++++-----------
 gdb/linux-thread-db.c        |  6 +++---
 gdb/nat/linux-osdata.c       |  6 +++---
 gdb/nat/linux-procfs.c       |  2 +-
 gdb/nto-procfs.c             |  6 +++---
 gdb/obsd-nat.c               |  4 ++--
 gdb/proc-service.c           |  8 ++++----
 gdb/procfs.c                 | 14 +++++++-------
 gdb/ravenscar-thread.c       |  6 +++---
 gdb/remote-sim.c             |  2 +-
 gdb/remote.c                 | 18 +++++++++---------
 gdb/sol-thread.c             | 16 ++++++++--------
 gdb/target.c                 |  2 +-
 gdb/windows-nat.c            | 27 +++++++++++++--------------
 34 files changed, 162 insertions(+), 135 deletions(-)

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index edb60f7c00..2ee61577af 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,33 @@ 
+2018-06-13  Tom Tromey  <tom@tromey.com>
+
+	* common/ptid.h (ptid_build): Don't declare.
+	* common/ptid.c (ptid_build): Remove.
+	* aix-thread.c: Update.
+	* bsd-kvm.c: Update.
+	* bsd-uthread.c: Update.
+	* common/agent.c: Update.
+	* common/ptid.c: Update.
+	* common/ptid.h: Update.
+	* corelow.c: Update.
+	* darwin-nat.c: Update.
+	* fbsd-nat.c: Update.
+	* gnu-nat.c: Update.
+	* linux-fork.c: Update.
+	* linux-nat.c: Update.
+	* linux-thread-db.c: Update.
+	* nat/linux-osdata.c: Update.
+	* nat/linux-procfs.c: Update.
+	* nto-procfs.c: Update.
+	* obsd-nat.c: Update.
+	* proc-service.c: Update.
+	* procfs.c: Update.
+	* ravenscar-thread.c: Update.
+	* remote-sim.c: Update.
+	* remote.c: Update.
+	* sol-thread.c: Update.
+	* target.c: Update.
+	* windows-nat.c: Update.
+
 2018-06-12  Andrew Burgess  <andrew.burgess@embecosm.com>
 	    Stephen Roberts  <stephen.roberts@arm.com>
 
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 8b1b0ed97f..f4d3ac4770 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -818,7 +818,7 @@  sync_threadlists (void)
 	  ptid_t pptid, gptid;
 	  int cmp_result;
 
-	  pptid = ptid_build (infpid, 0, pbuf[pi].pthid);
+	  pptid = ptid_t (infpid, 0, pbuf[pi].pthid);
 	  gptid = gbuf[gi]->ptid;
 	  pdtid = pbuf[pi].pdtid;
 	  tid = pbuf[pi].tid;
@@ -1832,7 +1832,7 @@  aix_thread_target::extra_thread_info (struct thread_info *thread)
 ptid_t
 aix_thread_target::get_ada_task_ptid (long lwp, long thread)
 {
-  return ptid_build (ptid_get_pid (inferior_ptid), 0, thread);
+  return ptid_t (ptid_get_pid (inferior_ptid), 0, thread);
 }
 
 
diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c
index 336dbf2b97..46c773ff95 100644
--- a/gdb/bsd-kvm.c
+++ b/gdb/bsd-kvm.c
@@ -413,5 +413,5 @@  Generic command for manipulating the kernel memory interface."),
      ptid (1, 1, 2) -> kvm inferior 1, process 2
      ptid (1, 1, n) -> kvm inferior 1, process n  */
 
-  bsd_kvm_ptid = ptid_build (1, 1, 0);
+  bsd_kvm_ptid = ptid_t (1, 1, 0);
 }
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index ee2e5ade96..4eeb787153 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -407,7 +407,7 @@  bsd_uthread_target::wait (ptid_t ptid, struct target_waitstatus *status,
 	{
 	  ULONGEST magic = extract_unsigned_integer (buf, 4, byte_order);
 	  if (magic == BSD_UTHREAD_PTHREAD_MAGIC)
-	    ptid = ptid_build (ptid_get_pid (ptid), 0, addr);
+	    ptid = ptid_t (ptid_get_pid (ptid), 0, addr);
 	}
     }
 
@@ -465,7 +465,7 @@  bsd_uthread_target::update_thread_list ()
   addr = bsd_uthread_read_memory_address (bsd_uthread_thread_list_addr);
   while (addr != 0)
     {
-      ptid_t ptid = ptid_build (pid, 0, addr);
+      ptid_t ptid = ptid_t (pid, 0, addr);
 
       if (!in_thread_list (ptid) || is_exited (ptid))
 	{
diff --git a/gdb/common/agent.c b/gdb/common/agent.c
index da91f2d60a..65d5f1938b 100644
--- a/gdb/common/agent.c
+++ b/gdb/common/agent.c
@@ -190,7 +190,7 @@  agent_run_command (int pid, const char *cmd, int len)
 {
   int fd;
   int tid = agent_get_helper_thread_id ();
-  ptid_t ptid = ptid_build (pid, tid, 0);
+  ptid_t ptid = ptid_t (pid, tid, 0);
 
   int ret = target_write_memory (ipa_sym_addrs.addr_cmd_buf,
 				 (gdb_byte *) cmd, len);
diff --git a/gdb/common/ptid.c b/gdb/common/ptid.c
index c3d2794141..49d27b4d55 100644
--- a/gdb/common/ptid.c
+++ b/gdb/common/ptid.c
@@ -27,14 +27,6 @@  ptid_t minus_one_ptid = ptid_t::make_minus_one ();
 
 /* See ptid.h.  */
 
-ptid_t
-ptid_build (int pid, long lwp, long tid)
-{
-  return ptid_t (pid, lwp, tid);
-}
-
-/* See ptid.h.  */
-
 ptid_t
 pid_to_ptid (int pid)
 {
diff --git a/gdb/common/ptid.h b/gdb/common/ptid.h
index 4b45452058..030e97d45b 100644
--- a/gdb/common/ptid.h
+++ b/gdb/common/ptid.h
@@ -158,10 +158,6 @@  extern ptid_t minus_one_ptid;
 
 /* See ptid_t::ptid_t.  */
 
-extern ptid_t ptid_build (int pid, long lwp, long tid);
-
-/* See ptid_t::ptid_t.  */
-
 extern ptid_t pid_to_ptid (int pid);
 
 /* See ptid_t::pid.  */
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 2ae233ec1a..99fe04c8c9 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -312,7 +312,7 @@  add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
       inf->fake_pid_p = fake_pid_p;
     }
 
-  ptid = ptid_build (pid, lwpid, 0);
+  ptid = ptid_t (pid, lwpid, 0);
 
   add_thread (ptid);
 
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index ed1ed32898..363a89f3c1 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -342,7 +342,7 @@  darwin_check_new_threads (struct inferior *inf)
 	  pti->msg_state = DARWIN_RUNNING;
 
 	  /* Add the new thread.  */
-	  add_thread_with_info (ptid_build (inf->pid, 0, new_id), pti);
+	  add_thread_with_info (ptid_t (inf->pid, 0, new_id), pti);
 	  new_thread_vec.push_back (pti);
 	  new_ix++;
 	  continue;
@@ -350,7 +350,7 @@  darwin_check_new_threads (struct inferior *inf)
       if (old_ix < old_nbr && (new_ix == new_nbr || new_id > old_id))
 	{
 	  /* A thread was removed.  */
-	  delete_thread (ptid_build (inf->pid, 0, old_id));
+	  delete_thread (ptid_t (inf->pid, 0, old_id));
 	  kret = mach_port_deallocate (gdb_task, old_id);
 	  MACH_CHECK_ERROR (kret);
 	  old_ix++;
@@ -1072,7 +1072,7 @@  darwin_decode_message (mach_msg_header_t *hdr,
 	  break;
 	}
 
-      return ptid_build (inf->pid, 0, thread->gdb_port);
+      return ptid_t (inf->pid, 0, thread->gdb_port);
     }
   else if (hdr->msgh_id == 0x48)
     {
@@ -1132,7 +1132,7 @@  darwin_decode_message (mach_msg_header_t *hdr,
 	      /* Looks necessary on Leopard and harmless...  */
 	      wait4 (inf->pid, &wstatus, 0, NULL);
 
-	      inferior_ptid = ptid_build (inf->pid, 0, 0);
+	      inferior_ptid = ptid_t (inf->pid, 0, 0);
 	      return inferior_ptid;
 	    }
 	  else
@@ -1140,7 +1140,7 @@  darwin_decode_message (mach_msg_header_t *hdr,
 	      inferior_debug (4, _("darwin_wait: pid=%d\n"), inf->pid);
 	      status->kind = TARGET_WAITKIND_EXITED;
 	      status->value.integer = 0; /* Don't know.  */
-	      return ptid_build (inf->pid, 0, 0);
+	      return ptid_t (inf->pid, 0, 0);
 	    }
 	}
     }
@@ -1211,7 +1211,7 @@  darwin_wait (ptid_t ptid, struct target_waitstatus *status)
       status->value.sig = GDB_SIGNAL_TRAP;
       thread = priv->threads[0];
       thread->msg_state = DARWIN_STOPPED;
-      return ptid_build (inf->pid, 0, thread->gdb_port);
+      return ptid_t (inf->pid, 0, thread->gdb_port);
     }
 
   do
@@ -1283,7 +1283,7 @@  darwin_wait (ptid_t ptid, struct target_waitstatus *status)
 	  && thread->event.ex_type == EXC_BREAKPOINT)
 	{
 	  if (thread->single_step
-	      || cancel_breakpoint (ptid_build (inf->pid, 0, thread->gdb_port)))
+	      || cancel_breakpoint (ptid_t (inf->pid, 0, thread->gdb_port)))
 	    {
 	      gdb_assert (thread->msg_state == DARWIN_MESSAGE);
 	      darwin_send_reply (inf, thread);
@@ -2255,7 +2255,7 @@  darwin_nat_target::get_ada_task_ptid (long lwp, long thread)
   for (darwin_thread_t *t : priv->threads)
     {
       if (t->inf_port == lwp)
-	return ptid_build (ptid_get_pid (inferior_ptid), 0, t->gdb_port);
+	return ptid_t (ptid_get_pid (inferior_ptid), 0, t->gdb_port);
     }
 
   /* Maybe the port was never extract.  Do it now.  */
@@ -2299,7 +2299,7 @@  darwin_nat_target::get_ada_task_ptid (long lwp, long thread)
                  names_count * sizeof (mach_port_t));
 
   if (res)
-    return ptid_build (ptid_get_pid (inferior_ptid), 0, res);
+    return ptid_t (ptid_get_pid (inferior_ptid), 0, res);
   else
     return null_ptid;
 }
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index 069e1e44be..cfacb2cf23 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -939,7 +939,7 @@  fbsd_add_threads (pid_t pid)
 
   for (i = 0; i < nlwps; i++)
     {
-      ptid_t ptid = ptid_build (pid, lwps[i], 0);
+      ptid_t ptid = ptid_t (pid, lwps[i], 0);
 
       if (!in_thread_list (ptid))
 	{
@@ -1253,7 +1253,7 @@  fbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
 	  if (ptrace (PT_LWPINFO, pid, (caddr_t) &pl, sizeof pl) == -1)
 	    perror_with_name (("ptrace"));
 
-	  wptid = ptid_build (pid, pl.pl_lwpid, 0);
+	  wptid = ptid_t (pid, pl.pl_lwpid, 0);
 
 	  if (debug_fbsd_nat)
 	    {
@@ -1356,7 +1356,7 @@  fbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
 		    perror_with_name (("ptrace"));
 
 		  gdb_assert (pl.pl_flags & PL_FLAG_CHILD);
-		  child_ptid = ptid_build (child, pl.pl_lwpid, 0);
+		  child_ptid = ptid_t (child, pl.pl_lwpid, 0);
 		}
 
 	      /* Enable additional events on the child process.  */
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index ac1eb1c909..86f77a957d 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,13 @@ 
+2018-06-13  Tom Tromey  <tom@tromey.com>
+
+	* linux-low.c: Update.
+	* lynx-low.c: Update.
+	* nto-low.c: Update.
+	* remote-utils.c: Update.
+	* spu-low.c: Update.
+	* thread-db.c: Update.
+	* win32-low.c: Update.
+
 2018-06-11  Alan Hayward  <alan.hayward@arm.com>
 
 	* linux-aarch64-ipa.c (get_ipa_tdesc): Add null VQ param.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 1211944d79..ce4d660806 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -523,7 +523,7 @@  handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
 	  struct thread_info *child_thr;
 	  struct target_desc *tdesc;
 
-	  ptid = ptid_build (new_pid, new_pid, 0);
+	  ptid = ptid_t (new_pid, new_pid, 0);
 
 	  if (debug_threads)
 	    {
@@ -630,7 +630,7 @@  handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
 		      "from LWP %ld, new child is LWP %ld\n",
 		      lwpid_of (event_thr), new_pid);
 
-      ptid = ptid_build (pid_of (event_thr), new_pid, 0);
+      ptid = ptid_t (pid_of (event_thr), new_pid, 0);
       new_lwp = add_lwp (ptid);
 
       /* Either we're going to immediately resume the new thread
@@ -1017,7 +1017,7 @@  linux_create_inferior (const char *program,
 
   linux_add_process (pid, 0);
 
-  ptid = ptid_build (pid, pid, 0);
+  ptid = ptid_t (pid, pid, 0);
   new_lwp = add_lwp (ptid);
   new_lwp->must_set_ptrace_flags = 1;
 
@@ -1185,7 +1185,7 @@  linux_attach (unsigned long pid)
 {
   struct process_info *proc;
   struct thread_info *initial_thread;
-  ptid_t ptid = ptid_build (pid, pid, 0);
+  ptid_t ptid = ptid_t (pid, pid, 0);
   int err;
 
   /* Attach to PID.  We will check for other threads
@@ -1202,7 +1202,7 @@  linux_attach (unsigned long pid)
 
   /* Don't ignore the initial SIGSTOP if we just attached to this
      process.  It will be collected by wait shortly.  */
-  initial_thread = find_thread_ptid (ptid_build (pid, pid, 0));
+  initial_thread = find_thread_ptid (ptid_t (pid, pid, 0));
   initial_thread->last_resume_kind = resume_stop;
 
   /* We must attach to every LWP.  If /proc is mounted, use that to
@@ -2391,7 +2391,7 @@  linux_low_filter_event (int lwpid, int wstat)
 			"after exec.\n", lwpid);
 	}
 
-      child_ptid = ptid_build (lwpid, lwpid, 0);
+      child_ptid = ptid_t (lwpid, lwpid, 0);
       child = add_lwp (child_ptid);
       child->stopped = 1;
       current_thread = child->thread;
diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c
index a0b9817729..b19ea62172 100644
--- a/gdb/gdbserver/lynx-low.c
+++ b/gdb/gdbserver/lynx-low.c
@@ -64,14 +64,14 @@  lynx_debug (char *string, ...)
 /* Build a ptid_t given a PID and a LynxOS TID.  */
 
 static ptid_t
-lynx_ptid_build (int pid, long tid)
+lynx_ptid_t (int pid, long tid)
 {
   /* brobecker/2010-06-21: It looks like the LWP field in ptids
      should be distinct for each thread (see write_ptid where it
      writes the thread ID from the LWP).  So instead of storing
      the LynxOS tid in the tid field of the ptid, we store it in
      the lwp field.  */
-  return ptid_build (pid, tid, 0);
+  return ptid_t (pid, tid, 0);
 }
 
 /* Return the process ID of the given PTID.
@@ -91,7 +91,7 @@  lynx_ptid_get_pid (ptid_t ptid)
 static long
 lynx_ptid_get_tid (ptid_t ptid)
 {
-  /* See lynx_ptid_build: The LynxOS tid is stored inside the lwp field
+  /* See lynx_ptid_t: The LynxOS tid is stored inside the lwp field
      of the ptid.  */
   return ptid_get_lwp (ptid);
 }
@@ -294,7 +294,7 @@  lynx_add_threads_after_attach (int pid)
     if ((sscanf (buf, "%d %d", &thread_pid, &thread_tid) == 2
 	 && thread_pid == pid))
     {
-      ptid_t thread_ptid = lynx_ptid_build (pid, thread_tid);
+      ptid_t thread_ptid = lynx_ptid_t (pid, thread_tid);
 
       if (!find_thread_ptid (thread_ptid))
 	{
@@ -312,7 +312,7 @@  lynx_add_threads_after_attach (int pid)
 static int
 lynx_attach (unsigned long pid)
 {
-  ptid_t ptid = lynx_ptid_build (pid, 0);
+  ptid_t ptid = lynx_ptid_t (pid, 0);
 
   if (lynx_ptrace (PTRACE_ATTACH, ptid, 0, 0, 0) != 0)
     error ("Cannot attach to process %lu: %s (%d)\n", pid,
@@ -430,7 +430,7 @@  lynx_wait_1 (ptid_t ptid, struct target_waitstatus *status, int options)
 retry:
 
   ret = lynx_waitpid (pid, &wstat);
-  new_ptid = lynx_ptid_build (ret, ((union wait *) &wstat)->w_tid);
+  new_ptid = lynx_ptid_t (ret, ((union wait *) &wstat)->w_tid);
   find_process_pid (ret)->priv->last_wait_event_ptid = new_ptid;
 
   /* If this is a new thread, then add it now.  The reason why we do
@@ -524,7 +524,7 @@  lynx_wait (ptid_t ptid, struct target_waitstatus *status, int options)
 static int
 lynx_kill (int pid)
 {
-  ptid_t ptid = lynx_ptid_build (pid, 0);
+  ptid_t ptid = lynx_ptid_t (pid, 0);
   struct target_waitstatus status;
   struct process_info *process;
 
@@ -543,7 +543,7 @@  lynx_kill (int pid)
 static int
 lynx_detach (int pid)
 {
-  ptid_t ptid = lynx_ptid_build (pid, 0);
+  ptid_t ptid = lynx_ptid_t (pid, 0);
   struct process_info *process;
 
   process = find_process_pid (pid);
diff --git a/gdb/gdbserver/nto-low.c b/gdb/gdbserver/nto-low.c
index b68b811159..ed28426542 100644
--- a/gdb/gdbserver/nto-low.c
+++ b/gdb/gdbserver/nto-low.c
@@ -142,7 +142,7 @@  nto_find_new_threads (struct nto_inferior *nto_inferior)
 	{
 	  struct thread_info *ti;
 
-	  ptid = ptid_build (nto_inferior->pid, tid, 0);
+	  ptid = ptid_t (nto_inferior->pid, tid, 0);
 	  ti = find_thread_ptid (ptid);
 	  if (ti != NULL)
 	    {
@@ -157,7 +157,7 @@  nto_find_new_threads (struct nto_inferior *nto_inferior)
       if (status.state != STATE_DEAD)
 	{
 	  TRACE ("Adding thread %d\n", tid);
-	  ptid = ptid_build (nto_inferior->pid, tid, 0);
+	  ptid = ptid_t (nto_inferior->pid, tid, 0);
 	  if (!find_thread_ptid (ptid))
 	    add_thread (ptid, NULL);
 	}
@@ -208,7 +208,7 @@  do_attach (pid_t pid)
       struct process_info *proc;
 
       kill (pid, SIGCONT);
-      ptid = ptid_build (status.pid, status.tid, 0);
+      ptid = ptid_t (status.pid, status.tid, 0);
       the_low_target.arch_setup ();
       proc = add_process (status.pid, 1);
       proc->tdesc = nto_tdesc;
@@ -609,7 +609,7 @@  nto_wait (ptid_t ptid,
 	}
     }
 
-  return ptid_build (status.pid, status.tid, 0);
+  return ptid_t (status.pid, status.tid, 0);
 }
 
 /* Fetch inferior's registers for currently selected thread (CURRENT_INFERIOR).
@@ -740,7 +740,7 @@  static void
 nto_request_interrupt (void)
 {
   TRACE ("%s\n", __func__);
-  nto_set_thread (ptid_build (nto_inferior.pid, 1, 0));
+  nto_set_thread (ptid_t (nto_inferior.pid, 1, 0));
   if (EOK != devctl (nto_inferior.ctl_fd, DCMD_PROC_STOP, NULL, 0, 0))
     TRACE ("Error stopping inferior.\n");
 }
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 967b2f0ebb..a1a06dcdf5 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -542,7 +542,7 @@  read_ptid (const char *buf, const char **obuf)
 
       if (obuf)
 	*obuf = pp;
-      return ptid_build (pid, tid, 0);
+      return ptid_t (pid, tid, 0);
     }
 
   /* No multi-process.  Just a tid.  */
@@ -555,7 +555,7 @@  read_ptid (const char *buf, const char **obuf)
 
   if (obuf)
     *obuf = pp;
-  return ptid_build (pid, tid, 0);
+  return ptid_t (pid, tid, 0);
 }
 
 /* Write COUNT bytes in BUF to the client.
diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c
index 5b880d2a42..13f2b353f2 100644
--- a/gdb/gdbserver/spu-low.c
+++ b/gdb/gdbserver/spu-low.c
@@ -297,7 +297,7 @@  spu_create_inferior (const char *program,
   proc = add_process (pid, 0);
   proc->tdesc = tdesc_spu;
 
-  ptid = ptid_build (pid, pid, 0);
+  ptid = ptid_t (pid, pid, 0);
   add_thread (ptid, NULL);
   return pid;
 }
@@ -319,7 +319,7 @@  spu_attach (unsigned long  pid)
 
   proc = add_process (pid, 1);
   proc->tdesc = tdesc_spu;
-  ptid = ptid_build (pid, pid, 0);
+  ptid = ptid_t (pid, pid, 0);
   add_thread (ptid, NULL);
   return 0;
 }
@@ -474,12 +474,12 @@  spu_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options)
     {
       ourstatus->kind = TARGET_WAITKIND_STOPPED;
       ourstatus->value.sig = GDB_SIGNAL_0;
-      return ptid_build (ret, ret, 0);
+      return ptid_t (ret, ret, 0);
     }
 
   ourstatus->kind = TARGET_WAITKIND_STOPPED;
   ourstatus->value.sig = gdb_signal_from_host (WSTOPSIG (w));
-  return ptid_build (ret, ret, 0);
+  return ptid_t (ret, ret, 0);
 }
 
 /* Fetch inferior registers.  */
diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c
index 7dda2edba0..3e42db4420 100644
--- a/gdb/gdbserver/thread-db.c
+++ b/gdb/gdbserver/thread-db.c
@@ -215,7 +215,7 @@  attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p)
 {
   struct process_info *proc = current_process ();
   int pid = pid_of (proc);
-  ptid_t ptid = ptid_build (pid, ti_p->ti_lid, 0);
+  ptid_t ptid = ptid_t (pid, ti_p->ti_lid, 0);
   struct lwp_info *lwp;
   int err;
 
diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c
index 8f5ea5aa59..05bea69adb 100644
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -120,7 +120,7 @@  current_thread_ptid (void)
 static ptid_t
 debug_event_ptid (DEBUG_EVENT *event)
 {
-  return ptid_build (event->dwProcessId, event->dwThreadId, 0);
+  return ptid_t (event->dwProcessId, event->dwThreadId, 0);
 }
 
 /* Get the thread context of the thread associated with TH.  */
@@ -208,7 +208,7 @@  static win32_thread_info *
 child_add_thread (DWORD pid, DWORD tid, HANDLE h, void *tlb)
 {
   win32_thread_info *th;
-  ptid_t ptid = ptid_build (pid, tid, 0);
+  ptid_t ptid = ptid_t (pid, tid, 0);
 
   if ((th = thread_rec (ptid, FALSE)))
     return th;
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index c7a40400fc..491d725ce2 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -1096,7 +1096,7 @@  inf_validate_procs (struct inf *inf)
 	    last = thread;
 	    proc_debug (thread, "new thread: %lu", threads[i]);
 
-	    ptid = ptid_build (inf->pid, thread->tid, 0);
+	    ptid = ptid_t (inf->pid, thread->tid, 0);
 
 	    /* Tell GDB's generic thread code.  */
 
@@ -1616,7 +1616,7 @@  rewait:
 
   thread = inf->wait.thread;
   if (thread)
-    ptid = ptid_build (inf->pid, thread->tid, 0);
+    ptid = ptid_t (inf->pid, thread->tid, 0);
   else if (ptid_equal (ptid, minus_one_ptid))
     thread = inf_tid_to_thread (inf, -1);
   else
@@ -1626,7 +1626,7 @@  rewait:
     {
       /* TID is dead; try and find a new thread.  */
       if (inf_update_procs (inf) && inf->threads)
-	ptid = ptid_build (inf->pid, inf->threads->tid, 0); /* The first
+	ptid = ptid_t (inf->pid, inf->threads->tid, 0); /* The first
 							       available
 							       thread.  */
       else
@@ -2167,7 +2167,7 @@  gnu_nat_target::create_inferior (const char *exec_file,
 
   /* We now have thread info.  */
   thread_change_ptid (inferior_ptid,
-		      ptid_build (inf->pid, inf_pick_first_thread (), 0));
+		      ptid_t (inf->pid, inf_pick_first_thread (), 0));
 
   gdb_startup_inferior (pid, START_INFERIOR_TRAPS_EXPECTED);
 
@@ -2228,7 +2228,7 @@  gnu_nat_target::attach (const char *args, int from_tty)
 
   inf_update_procs (inf);
 
-  inferior_ptid = ptid_build (pid, inf_pick_first_thread (), 0);
+  inferior_ptid = ptid_t (pid, inf_pick_first_thread (), 0);
 
   /* We have to initialize the terminal settings now, since the code
      below might try to restore them.  */
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 0ae213c825..2ba67e0bd4 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -94,7 +94,7 @@  add_fork (pid_t pid)
     }
 
   fp = XCNEW (struct fork_info);
-  fp->ptid = ptid_build (pid, pid, 0);
+  fp->ptid = ptid_t (pid, pid, 0);
   fp->num = ++highest_fork_num;
 
   if (fork_list == NULL)
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 445b59fa4a..aa1a22b8b5 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -940,7 +940,7 @@  find_lwp_pid (ptid_t ptid)
   else
     lwp = ptid_get_pid (ptid);
 
-  dummy.ptid = ptid_build (0, lwp, 0);
+  dummy.ptid = ptid_t (0, lwp, 0);
   lp = (struct lwp_info *) htab_find (lwp_lwpid_htab, &dummy);
   return lp;
 }
@@ -1196,9 +1196,9 @@  linux_nat_target::attach (const char *args, int from_tty)
 
   /* The ptrace base target adds the main thread with (pid,0,0)
      format.  Decorate it with lwp info.  */
-  ptid = ptid_build (ptid_get_pid (inferior_ptid),
-		     ptid_get_pid (inferior_ptid),
-		     0);
+  ptid = ptid_t (ptid_get_pid (inferior_ptid),
+		 ptid_get_pid (inferior_ptid),
+		 0);
   thread_change_ptid (inferior_ptid, ptid);
 
   /* Add the initial process as the first LWP to the list.  */
@@ -1958,7 +1958,7 @@  linux_handle_extended_wait (struct lwp_info *lp, int status)
 			    _("wait returned unexpected status 0x%x"), status);
 	}
 
-      ourstatus->value.related_pid = ptid_build (new_pid, new_pid, 0);
+      ourstatus->value.related_pid = ptid_t (new_pid, new_pid, 0);
 
       if (event == PTRACE_EVENT_FORK || event == PTRACE_EVENT_VFORK)
 	{
@@ -1977,7 +1977,7 @@  linux_handle_extended_wait (struct lwp_info *lp, int status)
 
 	  /* This won't actually modify the breakpoint list, but will
 	     physically remove the breakpoints from the child.  */
-	  detach_breakpoints (ptid_build (new_pid, new_pid, 0));
+	  detach_breakpoints (ptid_t (new_pid, new_pid, 0));
 
 	  /* Retain child fork in ptrace (stopped) state.  */
 	  if (!find_fork_pid (new_pid))
@@ -2008,7 +2008,7 @@  linux_handle_extended_wait (struct lwp_info *lp, int status)
 				"from LWP %d, new child is LWP %ld\n",
 				pid, new_pid);
 
-	  new_lp = add_lwp (ptid_build (ptid_get_pid (lp->ptid), new_pid, 0));
+	  new_lp = add_lwp (ptid_t (ptid_get_pid (lp->ptid), new_pid, 0));
 	  new_lp->stopped = 1;
 	  new_lp->resumed = 1;
 
@@ -2938,7 +2938,7 @@  linux_nat_filter_event (int lwpid, int status)
 			    "LLW: Re-adding thread group leader LWP %d.\n",
 			    lwpid);
 
-      lp = add_lwp (ptid_build (lwpid, lwpid, 0));
+      lp = add_lwp (ptid_t (lwpid, lwpid, 0));
       lp->stopped = 1;
       lp->resumed = 1;
       add_thread (lp->ptid);
@@ -3253,8 +3253,8 @@  linux_nat_wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
     {
       /* Upgrade the main thread's ptid.  */
       thread_change_ptid (inferior_ptid,
-			  ptid_build (ptid_get_pid (inferior_ptid),
-				      ptid_get_pid (inferior_ptid), 0));
+			  ptid_t (ptid_get_pid (inferior_ptid),
+				  ptid_get_pid (inferior_ptid), 0));
 
       lp = add_initial_lwp (inferior_ptid);
       lp->resumed = 1;
@@ -4235,7 +4235,7 @@  linux_nat_target::static_tracepoint_markers_by_strid (const char *strid)
   int pid = ptid_get_pid (inferior_ptid);
   std::vector<static_tracepoint_marker> markers;
   const char *p = s;
-  ptid_t ptid = ptid_build (pid, 0, 0);
+  ptid_t ptid = ptid_t (pid, 0, 0);
   static_tracepoint_marker marker;
 
   /* Pause all */
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index 192e0870cc..3a15b78b92 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -670,7 +670,7 @@  check_thread_db_callback (const td_thrhandle_t *th, void *arg)
      calls are made, we just assume they were; future changes
      to how GDB accesses TLS could result in this passing
      without exercising the calls it's supposed to.  */
-  ptid_t ptid = ptid_build (tdb_testinfo->info->pid, ti.ti_lid, 0);
+  ptid_t ptid = ptid_t (tdb_testinfo->info->pid, ti.ti_lid, 0);
   struct thread_info *thread_info = find_thread_ptid (ptid);
   if (thread_info != NULL && thread_info->priv != NULL)
     {
@@ -1476,7 +1476,7 @@  find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
 	return 0;
     }
 
-  ptid = ptid_build (info->pid, ti.ti_lid, 0);
+  ptid = ptid_t (info->pid, ti.ti_lid, 0);
   tp = find_thread_ptid (ptid);
   if (tp == NULL || tp->priv == NULL)
     record_thread (info, tp, ptid, th_p, &ti);
@@ -1780,7 +1780,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_build (ptid_get_pid (inferior_ptid), lwp, 0);
+  return ptid_t (ptid_get_pid (inferior_ptid), lwp, 0);
 }
 
 void
diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c
index 877b31b0b2..1f3a911473 100644
--- a/gdb/nat/linux-osdata.c
+++ b/gdb/nat/linux-osdata.c
@@ -266,8 +266,8 @@  get_cores_used_by_process (PID_T pid, int *cores, const int num_cores)
 	    continue;
 
 	  sscanf (dp->d_name, "%lld", &tid);
-	  core = linux_common_core_of_thread (ptid_build ((pid_t) pid,
-							  (pid_t) tid, 0));
+	  core = linux_common_core_of_thread (ptid_t ((pid_t) pid,
+						      (pid_t) tid, 0));
 
 	  if (core >= 0 && core < num_cores)
 	    {
@@ -595,7 +595,7 @@  linux_xfer_osdata_threads (gdb_byte *readbuf,
 			    continue;
 
 			  tid = atoi (dp2->d_name);
-			  core = linux_common_core_of_thread (ptid_build (pid, tid, 0));
+			  core = linux_common_core_of_thread (ptid_t (pid, tid, 0));
 
 			  buffer_xml_printf (
 			    &buffer,
diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c
index 55487507d0..5a9464195d 100644
--- a/gdb/nat/linux-procfs.c
+++ b/gdb/nat/linux-procfs.c
@@ -308,7 +308,7 @@  linux_proc_attach_tgid_threads (pid_t pid,
 	  lwp = strtoul (dp->d_name, NULL, 10);
 	  if (lwp != 0)
 	    {
-	      ptid_t ptid = ptid_build (pid, lwp, 0);
+	      ptid_t ptid = ptid_t (pid, lwp, 0);
 
 	      if (attach_lwp (ptid))
 		new_threads_found = 1;
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index a572fc166c..c1b38e8616 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -413,7 +413,7 @@  nto_procfs_target::update_thread_list ()
 	   returned different tid, meaning the requested tid no longer exists
 	   (e.g. thread exited).  */
 	continue;
-      ptid = ptid_build (pid, 0, tid);
+      ptid = ptid_t (pid, 0, tid);
       new_thread = find_thread_ptid (ptid);
       if (!new_thread)
 	new_thread = add_thread (ptid);
@@ -766,7 +766,7 @@  do_attach (ptid_t ptid)
       && status.flags & _DEBUG_FLAG_STOPPED)
     SignalKill (nto_node (), ptid_get_pid (ptid), 0, SIGCONT, 0, 0);
   nto_init_solib_absolute_prefix ();
-  return ptid_build (ptid_get_pid (ptid), 0, status.tid);
+  return ptid_t (ptid_get_pid (ptid), 0, status.tid);
 }
 
 /* Ask the user what to do when an interrupt is received.  */
@@ -899,7 +899,7 @@  nto_procfs_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
 	}
     }
 
-  return ptid_build (status.pid, 0, status.tid);
+  return ptid_t (status.pid, 0, status.tid);
 }
 
 /* Read the current values of the inferior's registers, both the
diff --git a/gdb/obsd-nat.c b/gdb/obsd-nat.c
index 91bed717a5..08e873d11f 100644
--- a/gdb/obsd-nat.c
+++ b/gdb/obsd-nat.c
@@ -62,7 +62,7 @@  obsd_nat_target::update_thread_list ()
 
   while (pts.pts_tid != -1)
     {
-      ptid_t ptid = ptid_build (pid, pts.pts_tid, 0);
+      ptid_t ptid = ptid_t (pid, pts.pts_tid, 0);
 
       if (!in_thread_list (ptid))
 	{
@@ -151,7 +151,7 @@  obsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
 	  return pid_to_ptid (pid);
 	}
 
-      ptid = ptid_build (pid, pe.pe_tid, 0);
+      ptid = ptid_t (pid, pe.pe_tid, 0);
       if (!in_thread_list (ptid))
 	{
 	  if (ptid_get_lwp (inferior_ptid) == 0)
diff --git a/gdb/proc-service.c b/gdb/proc-service.c
index 8afa667a06..7784f79438 100644
--- a/gdb/proc-service.c
+++ b/gdb/proc-service.c
@@ -131,7 +131,7 @@  ps_pdwrite (struct ps_prochandle *ph, psaddr_t addr,
 ps_err_e
 ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset)
 {
-  ptid_t ptid = ptid_build (ptid_get_pid (ph->ptid), lwpid, 0);
+  ptid_t ptid = ptid_t (ptid_get_pid (ph->ptid), lwpid, 0);
   struct regcache *regcache
     = get_thread_arch_regcache (ptid, target_gdbarch ());
 
@@ -147,7 +147,7 @@  ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset)
 ps_err_e
 ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid, const prgregset_t gregset)
 {
-  ptid_t ptid = ptid_build (ptid_get_pid (ph->ptid), lwpid, 0);
+  ptid_t ptid = ptid_t (ptid_get_pid (ph->ptid), lwpid, 0);
   struct regcache *regcache
     = get_thread_arch_regcache (ptid, target_gdbarch ());
 
@@ -163,7 +163,7 @@  ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid, const prgregset_t gregset)
 ps_err_e
 ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, gdb_prfpregset_t *fpregset)
 {
-  ptid_t ptid = ptid_build (ptid_get_pid (ph->ptid), lwpid, 0);
+  ptid_t ptid = ptid_t (ptid_get_pid (ph->ptid), lwpid, 0);
   struct regcache *regcache
     = get_thread_arch_regcache (ptid, target_gdbarch ());
 
@@ -180,7 +180,7 @@  ps_err_e
 ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid,
 	       const gdb_prfpregset_t *fpregset)
 {
-  ptid_t ptid = ptid_build (ptid_get_pid (ph->ptid), lwpid, 0);
+  ptid_t ptid = ptid_t (ptid_get_pid (ph->ptid), lwpid, 0);
   struct regcache *regcache
     = get_thread_arch_regcache (ptid, target_gdbarch ());
 
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 082f5d4374..c4e01673c0 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -1996,7 +1996,7 @@  do_attach (ptid_t ptid)
   create_procinfo (pi->pid, lwpid);
 
   /* Add it to gdb's thread list.  */
-  ptid = ptid_build (pi->pid, lwpid, 0);
+  ptid = ptid_t (pi->pid, lwpid, 0);
   add_thread (ptid);
 
   return ptid;
@@ -2283,7 +2283,7 @@  wait_again:
 
 	      /* The 'pid' we will return to GDB is composed of
 		 the process ID plus the lwp ID.  */
-	      retval = ptid_build (pi->pid, proc_get_current_thread (pi), 0);
+	      retval = ptid_t (pi->pid, proc_get_current_thread (pi), 0);
 
 	      switch (why) {
 	      case PR_SIGNALLED:
@@ -2400,7 +2400,7 @@  wait_again:
 		    if (!find_procinfo (pi->pid, temp_tid))
 		      create_procinfo  (pi->pid, temp_tid);
 
-		    temp_ptid = ptid_build (pi->pid, temp_tid, 0);
+		    temp_ptid = ptid_t (pi->pid, temp_tid, 0);
 		    /* If not in GDB's thread list, add it.  */
 		    if (!in_thread_list (temp_ptid))
 		      add_thread (temp_ptid);
@@ -2468,7 +2468,7 @@  wait_again:
 		      create_procinfo  (pi->pid, temp_tid);
 
 		    /* If not in GDB's thread list, add it.  */
-		    temp_ptid = ptid_build (pi->pid, temp_tid, 0);
+		    temp_ptid = ptid_t (pi->pid, temp_tid, 0);
 		    if (!in_thread_list (temp_ptid))
 		      add_thread (temp_ptid);
 
@@ -2960,7 +2960,7 @@  procfs_init_inferior (struct target_ops *ops, int pid)
      this point, but it didn't have any lwp info yet.  Notify the core
      about it.  This changes inferior_ptid as well.  */
   thread_change_ptid (pid_to_ptid (pid),
-		      ptid_build (pid, lwpid, 0));
+		      ptid_t (pid, lwpid, 0));
 
   gdb_startup_inferior (pid, START_INFERIOR_TRAPS_EXPECTED);
 }
@@ -3143,7 +3143,7 @@  procfs_inferior_created (struct target_ops *ops, int from_tty)
 static int
 procfs_notice_thread (procinfo *pi, procinfo *thread, void *ptr)
 {
-  ptid_t gdb_threadid = ptid_build (pi->pid, thread->tid, 0);
+  ptid_t gdb_threadid = ptid_t (pi->pid, thread->tid, 0);
 
   if (!in_thread_list (gdb_threadid) || is_exited (gdb_threadid))
     add_thread (gdb_threadid);
@@ -3807,7 +3807,7 @@  procfs_corefile_thread_callback (procinfo *pi, procinfo *thread, void *data)
 
   if (pi != NULL)
     {
-      ptid_t ptid = ptid_build (pi->pid, thread->tid, 0);
+      ptid_t ptid = ptid_t (pi->pid, thread->tid, 0);
 
       args->note_data = procfs_do_thread_registers (args->obfd, ptid,
 						    args->note_data,
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 01f58ee788..d269f388f5 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -211,7 +211,7 @@  get_base_thread_from_ravenscar_task (ptid_t ptid)
     return ptid;
 
   base_cpu = ravenscar_get_thread_base_cpu (ptid);
-  return ptid_build (ptid_get_pid (ptid), base_cpu, 0);
+  return ptid_t (ptid_get_pid (ptid), base_cpu, 0);
 }
 
 /* Fetch the ravenscar running thread from target memory and
@@ -384,7 +384,7 @@  ravenscar_active_task (int cpu)
   if (tid == 0)
     return null_ptid;
   else
-    return ptid_build (ptid_get_pid (base_ptid), 0, tid);
+    return ptid_t (ptid_get_pid (base_ptid), 0, tid);
 }
 
 const char *
@@ -571,7 +571,7 @@  ravenscar_inferior_created (struct target_ops *target, int from_tty)
 ptid_t
 ravenscar_thread_target::get_ada_task_ptid (long lwp, long thread)
 {
-  return ptid_build (ptid_get_pid (base_ptid), 0, thread);
+  return ptid_t (ptid_get_pid (base_ptid), 0, thread);
 }
 
 /* Command-list for the "set/show ravenscar" prefix command.  */
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 9c89ab9db7..cd69f72e23 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -253,7 +253,7 @@  get_sim_inferior_data (struct inferior *inf, int sim_instance_needed)
       set_inferior_data (inf, sim_inferior_data_key, sim_data);
 
       /* Allocate a ptid for this inferior.  */
-      sim_data->remote_sim_ptid = ptid_build (next_pid, 0, next_pid);
+      sim_data->remote_sim_ptid = ptid_t (next_pid, 0, next_pid);
       next_pid++;
 
       /* Initialize the other instance variables.  */
diff --git a/gdb/remote.c b/gdb/remote.c
index 7cef0cf19f..b72a27e62a 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -2953,7 +2953,7 @@  read_ptid (const char *buf, const char **obuf)
       pp = unpack_varlen_hex (p + 1, &tid);
       if (obuf)
 	*obuf = pp;
-      return ptid_build (pid, tid, 0);
+      return ptid_t (pid, tid, 0);
     }
 
   /* No multi-process.  Just a tid.  */
@@ -2978,7 +2978,7 @@  read_ptid (const char *buf, const char **obuf)
 
   if (obuf)
     *obuf = pp;
-  return ptid_build (pid, tid, 0);
+  return ptid_t (pid, tid, 0);
 }
 
 static int
@@ -3974,7 +3974,7 @@  remote_target::static_tracepoint_markers_by_strid (const char *strid)
 ptid_t
 remote_target::get_ada_task_ptid (long lwp, long thread)
 {
-  return ptid_build (ptid_get_pid (inferior_ptid), lwp, 0);
+  return ptid_t (ptid_get_pid (inferior_ptid), lwp, 0);
 }
 
 
@@ -6039,7 +6039,7 @@  remote_target::append_resumption (char *p, char *endp,
       ptid_t nptid;
 
       /* All (-1) threads of process.  */
-      nptid = ptid_build (ptid_get_pid (ptid), -1, 0);
+      nptid = ptid_t (ptid_get_pid (ptid), -1, 0);
 
       p += xsnprintf (p, endp - p, ":");
       p = write_ptid (p, endp, nptid);
@@ -6617,7 +6617,7 @@  remote_target::remote_stop_ns (ptid_t ptid)
 
       if (ptid_is_pid (ptid))
 	  /* All (-1) threads of process.  */
-	nptid = ptid_build (ptid_get_pid (ptid), -1, 0);
+	nptid = ptid_t (ptid_get_pid (ptid), -1, 0);
       else
 	{
 	  /* Small optimization: if we already have a stop reply for
@@ -11323,7 +11323,7 @@  threadalive_test (const char *cmd, int tty)
 {
   int sample_thread = SAMPLE_THREAD;
   int pid = ptid_get_pid (inferior_ptid);
-  ptid_t ptid = ptid_build (pid, sample_thread, 0);
+  ptid_t ptid = ptid_t (pid, sample_thread, 0);
 
   if (remote_thread_alive (ptid))
     printf_filtered ("PASS: Thread alive test\n");
@@ -14739,7 +14739,7 @@  stepping is supported by the target.  The default is on."),
 
   /* Take advantage of the fact that the TID field is not used, to tag
      special ptids with it set to != 0.  */
-  magic_null_ptid = ptid_build (42000, -1, 1);
-  not_sent_ptid = ptid_build (42000, -2, 1);
-  any_thread_ptid = ptid_build (42000, 0, 1);
+  magic_null_ptid = ptid_t (42000, -1, 1);
+  not_sent_ptid = ptid_t (42000, -2, 1);
+  any_thread_ptid = ptid_t (42000, 0, 1);
 }
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 47d86e469c..d67fd8352f 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -325,7 +325,7 @@  thread_to_lwp (ptid_t thread_id, int default_lwp)
 	     td_state_string (ti.ti_state));
     }
 
-  return ptid_build (ptid_get_pid (thread_id), ti.ti_lid, 0);
+  return ptid_t (ptid_get_pid (thread_id), ti.ti_lid, 0);
 }
 
 /* Convert an LWP ID into a POSIX or Solaris thread ID.  If LWP_ID
@@ -366,7 +366,7 @@  lwp_to_thread (ptid_t lwp)
   else if (val != TD_OK)
     error (_("lwp_to_thread: td_thr_get_info: %s."), td_err_string (val));
 
-  return ptid_build (ptid_get_pid (lwp), 0 , ti.ti_tid);
+  return ptid_t (ptid_get_pid (lwp), 0 , ti.ti_tid);
 }
 
 
@@ -849,7 +849,7 @@  ps_ptwrite (struct ps_prochandle *ph, psaddr_t addr,
 ps_err_e
 ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset)
 {
-  ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0);
+  ptid_t ptid = ptid_t (ptid_get_pid (inferior_ptid), lwpid, 0);
   struct regcache *regcache
     = get_thread_arch_regcache (ptid, target_gdbarch ());
 
@@ -865,7 +865,7 @@  ps_err_e
 ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid,
 	     const prgregset_t gregset)
 {
-  ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0);
+  ptid_t ptid = ptid_t (ptid_get_pid (inferior_ptid), lwpid, 0);
   struct regcache *regcache
     = get_thread_arch_regcache (ptid, target_gdbarch ());
 
@@ -917,7 +917,7 @@  ps_err_e
 ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid,
 	       prfpregset_t *fpregset)
 {
-  ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0);
+  ptid_t ptid = ptid_t (ptid_get_pid (inferior_ptid), lwpid, 0);
   struct regcache *regcache
     = get_thread_arch_regcache (ptid, target_gdbarch ());
 
@@ -933,7 +933,7 @@  ps_err_e
 ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid,
 	       const prfpregset_t * fpregset)
 {
-  ptid_t ptid = ptid_build (ptid_get_pid (inferior_ptid), lwpid, 0);
+  ptid_t ptid = ptid_t (ptid_get_pid (inferior_ptid), lwpid, 0);
   struct regcache *regcache
     = get_thread_arch_regcache (ptid, target_gdbarch ());
 
@@ -982,7 +982,7 @@  ps_lgetLDT (struct ps_prochandle *ph, lwpid_t lwpid,
   if (ptid_get_pid (inferior_ptid) <= 0 || lwpid <= 0)
     return PS_BADLID;
 
-  ret = procfs_find_LDT_entry (ptid_build (ptid_get_pid (inferior_ptid),
+  ret = procfs_find_LDT_entry (ptid_t (ptid_get_pid (inferior_ptid),
 			       lwpid, 0));
   if (ret)
     {
@@ -1042,7 +1042,7 @@  sol_update_thread_list_callback (const td_thrhandle_t *th, void *ignored)
   if (retval != TD_OK)
     return -1;
 
-  ptid = ptid_build (ptid_get_pid (inferior_ptid), 0, ti.ti_tid);
+  ptid = ptid_t (ptid_get_pid (inferior_ptid), 0, ti.ti_tid);
   if (!in_thread_list (ptid) || is_exited (ptid))
     add_thread (ptid);
 
diff --git a/gdb/target.c b/gdb/target.c
index a1fe8f9765..080480c609 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -618,7 +618,7 @@  default_terminal_info (struct target_ops *self, const char *args, int from_tty)
 static ptid_t
 default_get_ada_task_ptid (struct target_ops *self, long lwp, long tid)
 {
-  return ptid_build (ptid_get_pid (inferior_ptid), lwp, tid);
+  return ptid_t (ptid_get_pid (inferior_ptid), lwp, tid);
 }
 
 static enum exec_direction_kind
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 63a780014a..5eaa98af02 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -1350,8 +1350,8 @@  fake_create_process (void)
     }
   main_thread_id = current_event.dwThreadId;
   current_thread = windows_add_thread (
-		     ptid_build (current_event.dwProcessId, 0,
-				 current_event.dwThreadId),
+		     ptid_t (current_event.dwProcessId, 0,
+			     current_event.dwThreadId),
 		     current_event.u.CreateThread.hThread,
 		     current_event.u.CreateThread.lpThreadLocalBase);
   return main_thread_id;
@@ -1523,8 +1523,8 @@  get_windows_debug_event (struct target_ops *ops,
 	}
       /* Record the existence of this thread.  */
       thread_id = current_event.dwThreadId;
-      th = windows_add_thread (ptid_build (current_event.dwProcessId, 0,
-					 current_event.dwThreadId),
+      th = windows_add_thread (ptid_t (current_event.dwProcessId, 0,
+				       current_event.dwThreadId),
 			     current_event.u.CreateThread.hThread,
 			     current_event.u.CreateThread.lpThreadLocalBase);
 
@@ -1538,8 +1538,8 @@  get_windows_debug_event (struct target_ops *ops,
 
       if (current_event.dwThreadId != main_thread_id)
 	{
-	  windows_delete_thread (ptid_build (current_event.dwProcessId, 0,
-					     current_event.dwThreadId),
+	  windows_delete_thread (ptid_t (current_event.dwProcessId, 0,
+					 current_event.dwThreadId),
 				 current_event.u.ExitThread.dwExitCode);
 	  th = &dummy_thread_info;
 	}
@@ -1556,13 +1556,13 @@  get_windows_debug_event (struct target_ops *ops,
 
       current_process_handle = current_event.u.CreateProcessInfo.hProcess;
       if (main_thread_id)
-	windows_delete_thread (ptid_build (current_event.dwProcessId, 0,
-					   main_thread_id),
+	windows_delete_thread (ptid_t (current_event.dwProcessId, 0,
+				       main_thread_id),
 			       0);
       main_thread_id = current_event.dwThreadId;
       /* Add the main thread.  */
-      th = windows_add_thread (ptid_build (current_event.dwProcessId, 0,
-					   current_event.dwThreadId),
+      th = windows_add_thread (ptid_t (current_event.dwProcessId, 0,
+				       current_event.dwThreadId),
 	     current_event.u.CreateProcessInfo.hThread,
 	     current_event.u.CreateProcessInfo.lpThreadLocalBase);
       thread_id = current_event.dwThreadId;
@@ -1664,8 +1664,7 @@  get_windows_debug_event (struct target_ops *ops,
     }
   else
     {
-      inferior_ptid = ptid_build (current_event.dwProcessId, 0,
-				  thread_id);
+      inferior_ptid = ptid_t (current_event.dwProcessId, 0, thread_id);
       current_thread = th;
       if (!current_thread)
 	current_thread = thread_rec (thread_id, TRUE);
@@ -1725,7 +1724,7 @@  windows_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
       SetConsoleCtrlHandler (&ctrl_c_handler, FALSE);
 
       if (retval)
-	return ptid_build (current_event.dwProcessId, 0, retval);
+	return ptid_t (current_event.dwProcessId, 0, retval);
       else
 	{
 	  int detach = 0;
@@ -3000,7 +2999,7 @@  windows_nat_target::get_tib_address (ptid_t ptid, CORE_ADDR *addr)
 ptid_t
 windows_nat_target::get_ada_task_ptid (long lwp, long thread)
 {
-  return ptid_build (ptid_get_pid (inferior_ptid), 0, lwp);
+  return ptid_t (ptid_get_pid (inferior_ptid), 0, lwp);
 }
 
 /* Implementation of the to_thread_name method.  */