+2018-07-03 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-07-03 Tom Tromey <tom@tromey.com>
* infrun.c (follow_exec): Use exit_inferior_silent.
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;
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);
}
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);
}
{
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);
}
}
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);
thread_info *thread = find_thread_ptid (ptid);
if (thread == nullptr || thread->state == THREAD_EXITED)
{
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);
/* 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)
{
/* 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. */
inf->fake_pid_p = fake_pid_p;
}
- ptid = ptid_build (pid, lwpid, 0);
+ ptid = ptid_t (pid, lwpid, 0);
add_thread (ptid);
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;
{
/* A thread was removed. */
struct thread_info *thr
- = find_thread_ptid (ptid_build (inf->pid, 0, old_id));
+ = find_thread_ptid (ptid_t (inf->pid, 0, old_id));
delete_thread (thr);
kret = mach_port_deallocate (gdb_task, old_id);
MACH_CHECK_ERROR (kret);
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)
{
/* 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
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);
}
}
}
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
&& 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);
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. */
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;
}
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))
{
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)
{
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. */
+2018-07-03 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-29 Joel Brobecker <brobecker@adacore.com>
* linux-x86-tdesc.c (amd64_linux_read_description): Add missing
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)
{
"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
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;
{
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
/* 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
"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;
/* 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.
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);
}
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))
{
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,
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
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;
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);
{
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)
{
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);
}
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;
}
}
- 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).
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");
}
if (obuf)
*obuf = pp;
- return ptid_build (pid, tid, 0);
+ return ptid_t (pid, tid, 0);
}
/* No multi-process. Just a tid. */
if (obuf)
*obuf = pp;
- return ptid_build (pid, tid, 0);
+ return ptid_t (pid, tid, 0);
}
/* Write COUNT bytes in BUF to the client.
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;
}
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;
}
{
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. */
{
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;
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. */
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;
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. */
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
{
/* 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
/* 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);
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. */
}
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)
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;
}
/* 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. */
_("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)
{
/* 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))
"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;
"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);
{
/* 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;
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 */
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)
{
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
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)
{
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,
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;
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);
&& 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. */
}
}
- 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
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))
{
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)
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;
/* 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:
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);
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);
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);
}
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);
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,
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
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 *
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. */
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. */
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. */
if (obuf)
*obuf = pp;
- return ptid_build (pid, tid, 0);
+ return ptid_t (pid, tid, 0);
}
static int
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);
}
\f
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);
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
{
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");
/* 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);
}
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
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);
}
\f
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 ());
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 ());
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 ());
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 ());
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)
{
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);
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
}
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;
}
/* 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);
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;
}
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;
}
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);
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;
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. */