to it, delete the original thread, reset the new thread's
ptid, and switch to it. */
- if (ptid_equal (inferior_ptid, ptid))
+ if (inferior_ptid == ptid)
{
tp = new_thread (inf, null_ptid);
tpprev = NULL;
for (tp = thread_list; tp; tpprev = tp, tp = tp->next)
- if (ptid_equal (tp->ptid, ptid))
+ if (tp->ptid == ptid)
break;
if (!tp)
struct thread_info *tp;
for (tp = thread_list; tp; tp = tp->next)
- if (ptid_equal (tp->ptid, ptid))
+ if (tp->ptid == ptid)
return tp;
return NULL;
struct thread_info *tp;
for (tp = thread_list; tp; tp = tp->next)
- if (ptid_equal (tp->ptid, ptid))
+ if (tp->ptid == ptid)
return tp->global_num;
return 0;
struct thread_info *tp;
for (tp = thread_list; tp; tp = tp->next)
- if (ptid_equal (tp->ptid, ptid))
+ if (tp->ptid == ptid)
return 1;
return 0; /* Never heard of 'im. */
if (tp->state == THREAD_EXITED)
continue;
- if (ptid_equal (tp->ptid, inferior_ptid))
+ if (tp->ptid == inferior_ptid)
current_thread = tp->global_num;
num++;
set_resumed (ptid_t ptid, int resumed)
{
struct thread_info *tp;
- int all = ptid_equal (ptid, minus_one_ptid);
+ int all = ptid == minus_one_ptid;
if (all || ptid_is_pid (ptid))
{
set_running (ptid_t ptid, int running)
{
struct thread_info *tp;
- int all = ptid_equal (ptid, minus_one_ptid);
+ int all = ptid == minus_one_ptid;
int any_started = 0;
/* We try not to notify the observer if no thread has actually changed
set_executing (ptid_t ptid, int executing)
{
struct thread_info *tp;
- int all = ptid_equal (ptid, minus_one_ptid);
+ int all = ptid == minus_one_ptid;
if (all || ptid_is_pid (ptid))
{
threads_executing = 1;
/* Only clear the flag if the caller is telling us everything is
stopped. */
- else if (ptid_equal (minus_one_ptid, ptid))
+ else if (minus_one_ptid == ptid)
threads_executing = 0;
}
set_stop_requested (ptid_t ptid, int stop)
{
struct thread_info *tp;
- int all = ptid_equal (ptid, minus_one_ptid);
+ int all = ptid == minus_one_ptid;
if (all || ptid_is_pid (ptid))
{
int all;
int any_started = 0;
- all = ptid_equal (ptid, minus_one_ptid);
+ all = ptid == minus_one_ptid;
if (all || ptid_is_pid (ptid))
{
validate_registers_access (void)
{
/* No selected thread, no registers. */
- if (ptid_equal (inferior_ptid, null_ptid))
+ if (inferior_ptid == null_ptid)
error (_("No thread selected."));
/* Don't try to read from a dead thread. */
can_access_registers_ptid (ptid_t ptid)
{
/* No thread, no registers. */
- if (ptid_equal (ptid, null_ptid))
+ if (ptid == null_ptid)
return false;
/* Don't try to read from a dead thread. */
if (uiout->is_mi_like_p ())
{
/* Compatibility. */
- if (ptid_equal (tp->ptid, current_ptid))
+ if (tp->ptid == current_ptid)
uiout->text ("* ");
else
uiout->text (" ");
}
else
{
- if (ptid_equal (tp->ptid, current_ptid))
+ if (tp->ptid == current_ptid)
uiout->field_string ("current", "*");
else
uiout->field_skip ("current");
if (pid == -1 && requested_threads == NULL)
{
if (uiout->is_mi_like_p ()
- && !ptid_equal (inferior_ptid, null_ptid))
+ && inferior_ptid != null_ptid)
{
int num = ptid_to_global_thread_id (inferior_ptid);
uiout->field_int ("current-thread-id", num);
}
- if (!ptid_equal (inferior_ptid, null_ptid) && is_exited (inferior_ptid))
+ if (inferior_ptid != null_ptid && is_exited (inferior_ptid))
uiout->message ("\n\
The current thread <Thread ID %s> has terminated. See `help thread'.\n",
print_thread_id (inferior_thread ()));
- else if (thread_list != NULL
- && ptid_equal (inferior_ptid, null_ptid))
+ else if (thread_list != NULL && inferior_ptid == null_ptid)
uiout->message ("\n\
No selected thread. See `help thread'.\n");
}
/* Switch the program space as well, if we can infer it from the now
current thread. Otherwise, it's up to the caller to select the
space it wants. */
- if (!ptid_equal (ptid, null_ptid))
+ if (ptid != null_ptid)
{
struct inferior *inf;
set_current_inferior (inf);
}
- if (ptid_equal (ptid, inferior_ptid))
+ if (ptid == inferior_ptid)
return;
inferior_ptid = ptid;
/* We don't check for is_stopped, because we're called at times
while in the TARGET_RUNNING state, e.g., while handling an
internal event. */
- if (!ptid_equal (inferior_ptid, null_ptid)
+ if (inferior_ptid != null_ptid
&& !is_exited (ptid)
&& !is_executing (ptid))
stop_pc = regcache_read_pc (get_thread_regcache (ptid));
/* The running state of the originally selected thread may have
changed, so we have to recheck it here. */
- if (!ptid_equal (inferior_ptid, null_ptid)
+ if (inferior_ptid != null_ptid
&& old->was_stopped
&& is_stopped (inferior_ptid)
&& target_has_registers
old->inf_id = current_inferior ()->num;
old->was_removable = current_inferior ()->removable;
- if (!ptid_equal (inferior_ptid, null_ptid))
+ if (inferior_ptid != null_ptid)
{
struct frame_info *frame;
{
if (tidstr == NULL)
{
- if (ptid_equal (inferior_ptid, null_ptid))
+ if (inferior_ptid == null_ptid)
error (_("No thread selected"));
if (target_has_stack)
return;
/* Print if the thread has not changed, otherwise an event will be sent. */
- if (ptid_equal (inferior_ptid, previous_ptid))
+ if (inferior_ptid == previous_ptid)
{
print_selected_thread_frame (current_uiout,
USER_SELECTED_THREAD
{
struct thread_info *info;
- if (ptid_equal (inferior_ptid, null_ptid))
+ if (inferior_ptid == null_ptid)
error (_("No thread selected"));
arg = skip_spaces (arg);