Global renaming of find_thread_pid to find_thread_ptid.
* gdbthread.h (find_thread_ptid): Renamed from find_thread_pid.
* thread.c (find_thread_ptid): Renamed from find_thread_pid.
All callers updated.
gdbserver:
Global renaming of find_thread_pid to find_thread_ptid.
* server.h (find_thread_ptid): Renamed from find_thread_pid.
* inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
All callers updated.
2009-05-24 Doug Evans <dje@google.com>
+ Global renaming of find_thread_pid to find_thread_ptid.
+ * gdbthread.h (find_thread_ptid): Renamed from find_thread_pid.
+ * thread.c (find_thread_ptid): Renamed from find_thread_pid.
+ All callers updated.
+
* infrun.c (follow_fork): Initialize new step_* locals
to avoid "may be used uninitialized" warnings.
}
else
{
- thread = find_thread_pid (ptid);
+ thread = find_thread_ptid (ptid);
if (!thread)
error (_("aix-thread resume: unknown pthread %ld"),
TIDGET (ptid));
beneath->to_fetch_registers (beneath, regcache, regno);
else
{
- thread = find_thread_pid (inferior_ptid);
+ thread = find_thread_ptid (inferior_ptid);
tid = thread->private->tid;
if (tid == PTHDB_INVALID_TID)
beneath->to_store_registers (beneath, regcache, regno);
else
{
- thread = find_thread_pid (inferior_ptid);
+ thread = find_thread_ptid (inferior_ptid);
tid = thread->private->tid;
if (tid == PTHDB_INVALID_TID)
immediate_quit = 0;
if (!ptid_equal (inferior_ptid, null_ptid))
- tp = find_thread_pid (inferior_ptid);
+ tp = find_thread_ptid (inferior_ptid);
/* Perhaps it would be cleaner to do this via the cleanup chain (not sure
I can think of a reason why that is vital, though). */
2009-05-24 Doug Evans <dje@google.com>
+ Global renaming of find_thread_pid to find_thread_ptid.
+ * server.h (find_thread_ptid): Renamed from find_thread_pid.
+ * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
+ All callers updated.
+
* linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
to resume the newly created thread, don't call ptrace (PTRACE_CONT)
directly.
}
struct thread_info *
-find_thread_pid (ptid_t ptid)
+find_thread_ptid (ptid_t ptid)
{
struct inferior_list_entry *inf = all_threads.head;
ptid_t
gdb_id_to_thread_id (ptid_t gdb_id)
{
- struct thread_info *thread = find_thread_pid (gdb_id);
+ struct thread_info *thread = find_thread_ptid (gdb_id);
return thread ? thread->entry.id : null_ptid;
}
saved_inferior = current_inferior;
- current_inferior = find_thread_pid (ptid);
+ current_inferior = find_thread_ptid (ptid);
if (the_target->stopped_by_watchpoint != NULL
&& (*the_target->stopped_by_watchpoint) ())
err = 1;
else
{
- struct thread_info *thread = find_thread_pid (ptid);
+ struct thread_info *thread = find_thread_ptid (ptid);
if (thread == NULL)
err = 2;
int have_started_inferiors_p (void);
int have_attached_inferiors_p (void);
-struct thread_info *find_thread_pid (ptid_t ptid);
+struct thread_info *find_thread_ptid (ptid_t ptid);
ptid_t thread_id_to_gdb_id (ptid_t);
ptid_t thread_to_gdb_id (struct thread_info *);
struct thread_info *found;
if (use_general == 1)
- found = find_thread_pid (general_thread);
+ found = find_thread_ptid (general_thread);
else
{
found = NULL;
&& !ptid_equal (step_thread, minus_one_ptid))
&& (ptid_equal (cont_thread, null_ptid)
|| ptid_equal (cont_thread, minus_one_ptid)))
- found = find_thread_pid (step_thread);
+ found = find_thread_ptid (step_thread);
if (found == NULL)
- found = find_thread_pid (cont_thread);
+ found = find_thread_ptid (cont_thread);
}
if (found == NULL)
extern int valid_thread_id (int thread);
/* Search function to lookup a thread by 'pid'. */
-extern struct thread_info *find_thread_pid (ptid_t ptid);
+extern struct thread_info *find_thread_ptid (ptid_t ptid);
/* Find thread by GDB user-visible thread number. */
struct thread_info *find_thread_id (int num);
if (resume_all)
ptid = inferior_ptid;
- info = find_thread_pid (ptid);
+ info = find_thread_ptid (ptid);
inf_ttrace_resume_lwp (info, request, sig);
if (resume_all)
/* We haven't set the private member on the main thread yet. Do
it now. */
- ti = find_thread_pid (inferior_ptid);
+ ti = find_thread_ptid (inferior_ptid);
gdb_assert (ti != NULL && ti->private == NULL);
ti->private =
xmalloc (sizeof (struct inf_ttrace_private_thread_info));
case TTEVT_LWP_EXIT:
if (print_thread_events)
printf_unfiltered (_("[%s exited]\n"), target_pid_to_str (ptid));
- ti = find_thread_pid (ptid);
+ ti = find_thread_ptid (ptid);
gdb_assert (ti != NULL);
((struct inf_ttrace_private_thread_info *)ti->private)->dying = 1;
inf_ttrace_num_lwps--;
if (print_thread_events)
printf_unfiltered(_("[%s has been terminated]\n"),
target_pid_to_str (ptid));
- ti = find_thread_pid (ptid);
+ ti = find_thread_ptid (ptid);
gdb_assert (ti != NULL);
((struct inf_ttrace_private_thread_info *)ti->private)->dying = 1;
inf_ttrace_num_lwps--;
/* At this point the current thread may have changed. Refresh
CALL_THREAD as it could be invalid if its thread has exited. */
- call_thread = find_thread_pid (call_thread_ptid);
+ call_thread = find_thread_ptid (call_thread_ptid);
/* Don't restore the async mask if the target has changed,
saved_async is for the original target. */
struct thread_info *tp;
if (non_stop)
- tp = find_thread_pid (inferior_ptid);
+ tp = find_thread_ptid (inferior_ptid);
else
{
ptid_t last_ptid;
struct target_waitstatus ws;
get_last_target_status (&last_ptid, &ws);
- tp = find_thread_pid (last_ptid);
+ tp = find_thread_ptid (last_ptid);
}
if (tp != NULL)
bs = tp->stop_bpstat;
else if (is_running (ptid))
error (_("Selected thread is running."));
- tp = find_thread_pid (ptid);
+ tp = find_thread_ptid (ptid);
bs = tp->stop_bpstat;
stat = bpstat_num (&bs, &num);
or another. The previous selected thread may be gone
from the lists by now, but if it is still around, need
to clear the pending follow request. */
- tp = find_thread_pid (parent);
+ tp = find_thread_ptid (parent);
if (tp)
tp->pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
&& !ptid_equal (last_ptid, null_ptid)
&& !ptid_equal (last_ptid, minus_one_ptid))
{
- last_thread = find_thread_pid (last_ptid);
+ last_thread = find_thread_ptid (last_ptid);
if (last_thread)
{
tp->stop_signal = last_thread->stop_signal;
have consistent output as if the stop event had been
reported. */
ecs->ptid = info->ptid;
- ecs->event_thread = find_thread_pid (info->ptid);
+ ecs->event_thread = find_thread_ptid (info->ptid);
ecs->ws.kind = TARGET_WAITKIND_STOPPED;
ecs->ws.value.sig = TARGET_SIGNAL_0;
&& ecs->ws.kind != TARGET_WAITKIND_SIGNALLED && ecs->new_thread_event)
add_thread (ecs->ptid);
- ecs->event_thread = find_thread_pid (ecs->ptid);
+ ecs->event_thread = find_thread_ptid (ecs->ptid);
/* Dependent on valid ECS->EVENT_THREAD. */
adjust_pc_after_break (ecs);
stop_signal = ecs->event_thread->stop_signal;
ecs->event_thread->stop_signal = TARGET_SIGNAL_0;
ecs->ptid = singlestep_ptid;
- ecs->event_thread = find_thread_pid (ecs->ptid);
+ ecs->event_thread = find_thread_ptid (ecs->ptid);
ecs->event_thread->stop_signal = stop_signal;
stop_pc = new_singlestep_pc;
}
static void
exit_lwp (struct lwp_info *lp)
{
- struct thread_info *th = find_thread_pid (lp->ptid);
+ struct thread_info *th = find_thread_ptid (lp->ptid);
if (th)
{
have the last signal recorded in
thread_info->stop_signal. */
- struct thread_info *tp = find_thread_pid (lp->ptid);
+ struct thread_info *tp = find_thread_ptid (lp->ptid);
signo = tp->stop_signal;
}
{
if (GET_LWP (lp->ptid) == GET_LWP (last_ptid))
{
- struct thread_info *tp = find_thread_pid (lp->ptid);
+ struct thread_info *tp = find_thread_ptid (lp->ptid);
if (tp->stop_signal != TARGET_SIGNAL_0
&& signal_pass_state (tp->stop_signal))
*status = W_STOPCODE (target_signal_to_host (tp->stop_signal));
if (debug_linux_nat)
{
- if (find_thread_pid (lwp->ptid)->stop_requested)
+ if (find_thread_ptid (lwp->ptid)->stop_requested)
fprintf_unfiltered (gdb_stdlog, "\
LNSL: already stopped/stop_requested %s\n",
target_pid_to_str (lwp->ptid));
/* Fill the cache. */
thread_ptid = ptid_build (info->pid, ti.ti_lid, 0);
- inout->thread_info = find_thread_pid (thread_ptid);
+ inout->thread_info = find_thread_ptid (thread_ptid);
/* In the case of a zombie thread, don't continue. We don't want to
attach to it thinking it is a new thread. */
thread_db_find_new_threads_1 (thread_ptid);
else
attach_thread (thread_ptid, thp, &ti);
- inout->thread_info = find_thread_pid (thread_ptid);
+ inout->thread_info = find_thread_ptid (thread_ptid);
gdb_assert (inout->thread_info != NULL);
}
thread and attach to the new one. */
if (in_thread_list (ptid))
{
- tp = find_thread_pid (ptid);
+ tp = find_thread_ptid (ptid);
gdb_assert (tp != NULL);
/* If tp->private is NULL, then GDB is already attached to this
until we notice that it's dead (via prune_threads), or until
something re-uses its thread ID. We'll report the thread exit
when the underlying LWP dies. */
- thread_info = find_thread_pid (ptid);
+ thread_info = find_thread_ptid (ptid);
gdb_assert (thread_info != NULL && thread_info->private != NULL);
thread_info->private->dying = 1;
}
}
ptid = ptid_build (info->pid, ti.ti_lid, 0);
- tp = find_thread_pid (ptid);
+ tp = find_thread_ptid (ptid);
if (tp == NULL || tp->private == NULL)
attach_thread (ptid, th_p, &ti);
static char *
thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid)
{
- struct thread_info *thread_info = find_thread_pid (ptid);
+ struct thread_info *thread_info = find_thread_ptid (ptid);
struct target_ops *beneath;
if (thread_info != NULL && thread_info->private != NULL)
thread_db_find_new_threads_1 (ptid);
/* Find the matching thread. */
- thread_info = find_thread_pid (ptid);
+ thread_info = find_thread_ptid (ptid);
if (thread_info != NULL && thread_info->private != NULL)
{
if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid))
tp = inferior_thread ();
else
- tp = find_thread_pid (ptid);
+ tp = find_thread_ptid (ptid);
/* Suppress output while calling an inferior function. */
if (tp->in_infcall)
}
else
{
- struct thread_info *ti = find_thread_pid (ptid);
+ struct thread_info *ti = find_thread_ptid (ptid);
gdb_assert (ti);
fprintf_unfiltered (raw_stdout, "*running,thread-id=\"%d\"\n", ti->num);
}
struct thread_info*
inferior_thread (void)
{
- struct thread_info *tp = find_thread_pid (inferior_ptid);
+ struct thread_info *tp = find_thread_ptid (inferior_ptid);
gdb_assert (tp);
return tp;
}
{
struct thread_info *tp;
- tp = find_thread_pid (ptid);
+ tp = find_thread_ptid (ptid);
if (tp)
/* Found an old thread with the same id. It has to be dead,
otherwise we wouldn't be adding a new thread with the same id.
/* Find a thread_info by matching PTID. */
struct thread_info *
-find_thread_pid (ptid_t ptid)
+find_thread_ptid (ptid_t ptid)
{
struct thread_info *tp;
inf = find_inferior_pid (ptid_get_pid (old_ptid));
inf->pid = ptid_get_pid (new_ptid);
- tp = find_thread_pid (old_ptid);
+ tp = find_thread_ptid (old_ptid);
tp->ptid = new_ptid;
observer_notify_thread_ptid_changed (old_ptid, new_ptid);
else
{
int started = 0;
- tp = find_thread_pid (ptid);
+ tp = find_thread_ptid (ptid);
gdb_assert (tp);
gdb_assert (tp->state_ != THREAD_EXITED);
if (running && tp->state_ == THREAD_STOPPED)
if (!target_has_execution)
return 0;
- tp = find_thread_pid (ptid);
+ tp = find_thread_ptid (ptid);
gdb_assert (tp);
return tp->state_ == state;
}
if (!target_has_execution)
return 0;
- tp = find_thread_pid (ptid);
+ tp = find_thread_ptid (ptid);
gdb_assert (tp);
return tp->executing_;
}
}
else
{
- tp = find_thread_pid (ptid);
+ tp = find_thread_ptid (ptid);
gdb_assert (tp);
tp->executing_ = executing;
}
}
else
{
- tp = find_thread_pid (ptid);
+ tp = find_thread_ptid (ptid);
gdb_assert (tp);
tp->stop_requested = stop;
}
}
else
{
- tp = find_thread_pid (ptid);
+ tp = find_thread_ptid (ptid);
gdb_assert (tp);
if (tp->state_ != THREAD_EXITED)
{
struct thread_info *tp;
struct current_thread_cleanup *old = arg;
- tp = find_thread_pid (old->inferior_ptid);
+ tp = find_thread_ptid (old->inferior_ptid);
/* If the previously selected thread belonged to a process that has
in the mean time been deleted (due to normal exit, detach, etc.),
{
struct current_thread_cleanup *old = arg;
struct thread_info *tp;
- tp = find_thread_pid (old->inferior_ptid);
+ tp = find_thread_ptid (old->inferior_ptid);
if (tp)
tp->refcount--;
xfree (old);
old->selected_frame_id = get_frame_id (frame);
old->selected_frame_level = frame_relative_level (frame);
- tp = find_thread_pid (inferior_ptid);
+ tp = find_thread_ptid (inferior_ptid);
if (tp)
tp->refcount++;
}