aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-06-11 14:45:22 -0600
committerTom Tromey <tom@tromey.com>2018-07-03 11:36:46 -0600
commitd7e15655a40e9133a1cbf53ea071f82cd6745ac8 (patch)
tree78381ff8daa008d7debde45e889279381d95bd91 /gdb/gdbserver
parent26a57c9256d7ec2b4da2f1d85a9fba830948dbd9 (diff)
downloadgdb-d7e15655a40e9133a1cbf53ea071f82cd6745ac8.zip
gdb-d7e15655a40e9133a1cbf53ea071f82cd6745ac8.tar.gz
gdb-d7e15655a40e9133a1cbf53ea071f82cd6745ac8.tar.bz2
Remove ptid_equal
Remove ptid_equal in favor of using "==". gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_equal): Remove. * common/ptid.h (ptid_equal): Don't declare. * ada-tasks.c: Update. * breakpoint.c: Update. * common/agent.c: Update. * corelow.c: Update. * darwin-nat-info.c: Update. * darwin-nat.c: Update. * dcache.c: Update. * dtrace-probe.c: Update. * dummy-frame.c: Update. * fbsd-nat.c: Update. * frame.c: Update. * gdbthread.h: Update. * gnu-nat.c: Update. * go32-nat.c: Update. * inf-loop.c: Update. * inf-ptrace.c: Update. * infcall.c: Update. * infcmd.c: Update. * inflow.c: Update. * infrun.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * linux-thread-db.c: Update. * mi/mi-cmd-var.c: Update. * mi/mi-interp.c: Update. * mi/mi-main.c: Update. * nto-procfs.c: Update. * ppc-linux-tdep.c: Update. * procfs.c: Update. * python/py-inferior.c: Update. * python/py-record-btrace.c: Update. * python/py-record.c: Update. * ravenscar-thread.c: Update. * regcache.c: Update. * remote-sim.c: Update. * remote.c: Update. * sol-thread.c: Update. * solib.c: Update. * target.c: Update. * tui/tui-stack.c: Update. * varobj.c: Update. * windows-nat.c: Update. * windows-tdep.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * linux-low.c: Update. * lynx-low.c: Update. * mem-break.c: Update. * nto-low.c: Update. * remote-utils.c: Update. * server.c: Update. * spu-low.c: Update. * target.c: Update. * win32-low.c: Update.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog12
-rw-r--r--gdb/gdbserver/linux-low.c20
-rw-r--r--gdb/gdbserver/lynx-low.c6
-rw-r--r--gdb/gdbserver/mem-break.c12
-rw-r--r--gdb/gdbserver/nto-low.c4
-rw-r--r--gdb/gdbserver/remote-utils.c2
-rw-r--r--gdb/gdbserver/server.c26
-rw-r--r--gdb/gdbserver/spu-low.c6
-rw-r--r--gdb/gdbserver/target.c4
-rw-r--r--gdb/gdbserver/win32-low.c4
10 files changed, 52 insertions, 44 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 5e2d64e..a59999a 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,17 @@
2018-07-03 Tom Tromey <tom@tromey.com>
+ * linux-low.c: Update.
+ * lynx-low.c: Update.
+ * mem-break.c: Update.
+ * nto-low.c: Update.
+ * remote-utils.c: Update.
+ * server.c: Update.
+ * spu-low.c: Update.
+ * target.c: Update.
+ * win32-low.c: Update.
+
+2018-07-03 Tom Tromey <tom@tromey.com>
+
* server.c: Update.
2018-07-03 Tom Tromey <tom@tromey.com>
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index cef528b..6e026f1 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -2635,7 +2635,7 @@ linux_wait_for_event_filtered (ptid_t wait_ptid, ptid_t filter_ptid,
/* Check for a lwp with a pending status. */
- if (ptid_equal (filter_ptid, minus_one_ptid) || filter_ptid.is_pid ())
+ if (filter_ptid == minus_one_ptid || filter_ptid.is_pid ())
{
event_thread = find_thread_in_random ([&] (thread_info *thread)
{
@@ -2647,7 +2647,7 @@ linux_wait_for_event_filtered (ptid_t wait_ptid, ptid_t filter_ptid,
if (debug_threads && event_thread)
debug_printf ("Got a pending child %ld\n", lwpid_of (event_thread));
}
- else if (!ptid_equal (filter_ptid, null_ptid))
+ else if (filter_ptid != null_ptid)
{
requested_child = find_lwp_pid (filter_ptid);
@@ -3159,7 +3159,7 @@ linux_wait_1 (ptid_t ptid,
else
any_resumed = 0;
- if (ptid_equal (step_over_bkpt, null_ptid))
+ if (step_over_bkpt == null_ptid)
pid = linux_wait_for_event (ptid, &w, options);
else
{
@@ -3248,7 +3248,7 @@ linux_wait_1 (ptid_t ptid,
if it's not the single_step_breakpoint we are hitting.
This avoids that a program would keep trapping a permanent breakpoint
forever. */
- if (!ptid_equal (step_over_bkpt, null_ptid)
+ if (step_over_bkpt != null_ptid
&& event_child->stop_reason == TARGET_STOPPED_BY_SW_BREAKPOINT
&& (event_child->stepping
|| !single_step_breakpoint_inserted_here (event_child->stop_pc)))
@@ -3736,7 +3736,7 @@ linux_wait_1 (ptid_t ptid,
from among those that have had events. Giving equal priority
to all LWPs that have had events helps prevent
starvation. */
- if (ptid_equal (ptid, minus_one_ptid))
+ if (ptid == minus_one_ptid)
{
event_child->status_pending_p = 1;
event_child->status_pending = w;
@@ -3827,7 +3827,7 @@ linux_wait_1 (ptid_t ptid,
ourstatus->value.sig = gdb_signal_from_host (WSTOPSIG (w));
}
- gdb_assert (ptid_equal (step_over_bkpt, null_ptid));
+ gdb_assert (step_over_bkpt == null_ptid);
if (debug_threads)
{
@@ -3886,14 +3886,14 @@ linux_wait (ptid_t ptid,
event_ptid = linux_wait_1 (ptid, ourstatus, target_options);
}
while ((target_options & TARGET_WNOHANG) == 0
- && ptid_equal (event_ptid, null_ptid)
+ && event_ptid == null_ptid
&& ourstatus->kind == TARGET_WAITKIND_IGNORE);
/* If at least one stop was reported, there may be more. A single
SIGCHLD can signal more than one child stop. */
if (target_is_async_p ()
&& (target_options & TARGET_WNOHANG) != 0
- && !ptid_equal (event_ptid, null_ptid))
+ && event_ptid != null_ptid)
async_file_mark ();
return event_ptid;
@@ -4542,7 +4542,7 @@ linux_set_resume_request (thread_info *thread, thread_resume *resume, size_t n)
for (int ndx = 0; ndx < n; ndx++)
{
ptid_t ptid = resume[ndx].thread;
- if (ptid_equal (ptid, minus_one_ptid)
+ if (ptid == minus_one_ptid
|| ptid == thread->id
/* Handle both 'pPID' and 'pPID.-1' as meaning 'all threads
of PID'. */
@@ -4899,7 +4899,7 @@ finish_step_over (struct lwp_info *lwp)
static void
complete_ongoing_step_over (void)
{
- if (!ptid_equal (step_over_bkpt, null_ptid))
+ if (step_over_bkpt != null_ptid)
{
struct lwp_info *lwp;
int wstat;
diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c
index 8d79ab1..b68bbea 100644
--- a/gdb/gdbserver/lynx-low.c
+++ b/gdb/gdbserver/lynx-low.c
@@ -342,14 +342,14 @@ lynx_resume (struct thread_resume *resume_info, size_t n)
LynxOS 178 is a little more sensitive, and triggers some
unexpected signals (Eg SIG61) when we resume the inferior
using a different thread. */
- if (ptid_equal (ptid, minus_one_ptid))
+ if (ptid == minus_one_ptid)
ptid = current_process()->priv->last_wait_event_ptid;
/* The ptid might still be minus_one_ptid; this can happen between
the moment we create the inferior or attach to a process, and
the moment we resume its execution for the first time. It is
fine to use the current_thread's ptid in those cases. */
- if (ptid_equal (ptid, minus_one_ptid))
+ if (ptid == minus_one_ptid)
ptid = ptid_of (current_thread);
regcache_invalidate_pid (ptid.pid ());
@@ -422,7 +422,7 @@ lynx_wait_1 (ptid_t ptid, struct target_waitstatus *status, int options)
int wstat;
ptid_t new_ptid;
- if (ptid_equal (ptid, minus_one_ptid))
+ if (ptid == minus_one_ptid)
pid = lynx_ptid_get_pid (ptid_of (current_thread));
else
pid = BUILDPID (lynx_ptid_get_pid (ptid), lynx_ptid_get_tid (ptid));
diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c
index 7ad8c48..447afc7 100644
--- a/gdb/gdbserver/mem-break.c
+++ b/gdb/gdbserver/mem-break.c
@@ -1501,8 +1501,7 @@ delete_single_step_breakpoints (struct thread_info *thread)
while (bp)
{
if (bp->type == single_step_breakpoint
- && ptid_equal (((struct single_step_breakpoint *) bp)->ptid,
- ptid_of (thread)))
+ && ((struct single_step_breakpoint *) bp)->ptid == ptid_of (thread))
{
struct thread_info *saved_thread = current_thread;
@@ -1598,8 +1597,7 @@ uninsert_single_step_breakpoints (struct thread_info *thread)
for (bp = proc->breakpoints; bp != NULL; bp = bp->next)
{
if (bp->type == single_step_breakpoint
- && ptid_equal (((struct single_step_breakpoint *) bp)->ptid,
- ptid_of (thread)))
+ && ((struct single_step_breakpoint *) bp)->ptid == ptid_of (thread))
{
gdb_assert (bp->raw->inserted > 0);
@@ -1673,8 +1671,7 @@ has_single_step_breakpoints (struct thread_info *thread)
while (bp)
{
if (bp->type == single_step_breakpoint
- && ptid_equal (((struct single_step_breakpoint *) bp)->ptid,
- ptid_of (thread)))
+ && ((struct single_step_breakpoint *) bp)->ptid == ptid_of (thread))
return 1;
else
{
@@ -1708,8 +1705,7 @@ reinsert_single_step_breakpoints (struct thread_info *thread)
for (bp = proc->breakpoints; bp != NULL; bp = bp->next)
{
if (bp->type == single_step_breakpoint
- && ptid_equal (((struct single_step_breakpoint *) bp)->ptid,
- ptid_of (thread)))
+ && ((struct single_step_breakpoint *) bp)->ptid == ptid_of (thread))
{
gdb_assert (bp->raw->inserted > 0);
diff --git a/gdb/gdbserver/nto-low.c b/gdb/gdbserver/nto-low.c
index 21f6da6..236e555 100644
--- a/gdb/gdbserver/nto-low.c
+++ b/gdb/gdbserver/nto-low.c
@@ -94,8 +94,8 @@ nto_set_thread (ptid_t ptid)
TRACE ("%s pid: %d tid: %ld\n", __func__, ptid.pid (),
ptid.lwp ());
if (nto_inferior.ctl_fd != -1
- && !ptid_equal (ptid, null_ptid)
- && !ptid_equal (ptid, minus_one_ptid))
+ && ptid != null_ptid
+ && ptid != minus_one_ptid)
{
pthread_t tid = ptid.lwp ();
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index ac57ce5..45d5c8d 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -1222,7 +1222,7 @@ prepare_resume_reply (char *buf, ptid_t ptid,
in GDB will claim this event belongs to inferior_ptid
if we do not specify a thread, and there's no way for
gdbserver to know what inferior_ptid is. */
- if (1 || !ptid_equal (cs.general_thread, ptid))
+ if (1 || cs.general_thread != ptid)
{
int core = -1;
/* In non-stop, don't change the general thread behind
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 3c58c6e..e5d226c 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -441,8 +441,8 @@ handle_btrace_general_set (char *own_buf)
op = own_buf + strlen ("Qbtrace:");
- if (ptid_equal (cs.general_thread, null_ptid)
- || ptid_equal (cs.general_thread, minus_one_ptid))
+ if (cs.general_thread == null_ptid
+ || cs.general_thread == minus_one_ptid)
{
strcpy (own_buf, "E.Must select a single thread.");
return -1;
@@ -491,8 +491,8 @@ handle_btrace_conf_general_set (char *own_buf)
op = own_buf + strlen ("Qbtrace-conf:");
- if (ptid_equal (cs.general_thread, null_ptid)
- || ptid_equal (cs.general_thread, minus_one_ptid))
+ if (cs.general_thread == null_ptid
+ || cs.general_thread == minus_one_ptid)
{
strcpy (own_buf, "E.Must select a single thread.");
return -1;
@@ -1829,8 +1829,8 @@ handle_qxfer_btrace (const char *annex,
if (writebuf != NULL)
return -2;
- if (ptid_equal (cs.general_thread, null_ptid)
- || ptid_equal (cs.general_thread, minus_one_ptid))
+ if (cs.general_thread == null_ptid
+ || cs.general_thread == minus_one_ptid)
{
strcpy (cs.own_buf, "E.Must select a single thread.");
return -3;
@@ -1913,8 +1913,8 @@ handle_qxfer_btrace_conf (const char *annex,
if (annex[0] != '\0')
return -1;
- if (ptid_equal (cs.general_thread, null_ptid)
- || ptid_equal (cs.general_thread, minus_one_ptid))
+ if (cs.general_thread == null_ptid
+ || cs.general_thread == minus_one_ptid)
{
strcpy (cs.own_buf, "E.Must select a single thread.");
return -3;
@@ -2696,8 +2696,8 @@ visit_actioned_threads (thread_info *thread,
{
const struct thread_resume *action = &actions[i];
- if (ptid_equal (action->thread, minus_one_ptid)
- || ptid_equal (action->thread, thread->id)
+ if (action->thread == minus_one_ptid
+ || action->thread == thread->id
|| ((action->thread.pid ()
== thread->id.pid ())
&& action->thread.lwp () == -1))
@@ -3199,8 +3199,8 @@ myresume (char *own_buf, int step, int sig)
int n = 0;
int valid_cont_thread;
- valid_cont_thread = (!ptid_equal (cs.cont_thread, null_ptid)
- && !ptid_equal (cs.cont_thread, minus_one_ptid));
+ valid_cont_thread = (cs.cont_thread != null_ptid
+ && cs.cont_thread != minus_one_ptid);
if (step || sig || valid_cont_thread)
{
@@ -4095,7 +4095,7 @@ process_serial_event (void)
if (cs.own_buf[1] == 'g')
{
- if (ptid_equal (thread_id, null_ptid))
+ if (thread_id == null_ptid)
{
/* GDB is telling us to choose any thread. Check if
the currently selected thread is still valid. If
diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c
index b3980e7..e9fc6e7 100644
--- a/gdb/gdbserver/spu-low.c
+++ b/gdb/gdbserver/spu-low.c
@@ -383,7 +383,7 @@ spu_join (int pid)
static int
spu_thread_alive (ptid_t ptid)
{
- return ptid_equal (ptid, current_ptid);
+ return ptid == current_ptid;
}
/* Resume process. */
@@ -394,8 +394,8 @@ spu_resume (struct thread_resume *resume_info, size_t n)
size_t i;
for (i = 0; i < n; i++)
- if (ptid_equal (resume_info[i].thread, minus_one_ptid)
- || ptid_equal (resume_info[i].thread, ptid_of (thr)))
+ if (resume_info[i].thread == minus_one_ptid
+ || resume_info[i].thread == ptid_of (thr))
break;
if (i == n)
diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
index 81d7cc4..00379bf 100644
--- a/gdb/gdbserver/target.c
+++ b/gdb/gdbserver/target.c
@@ -314,9 +314,9 @@ target_pid_to_str (ptid_t ptid)
{
static char buf[80];
- if (ptid_equal (ptid, minus_one_ptid))
+ if (ptid == minus_one_ptid)
xsnprintf (buf, sizeof (buf), "<all threads>");
- else if (ptid_equal (ptid, null_ptid))
+ else if (ptid == null_ptid)
xsnprintf (buf, sizeof (buf), "<null thread>");
else if (ptid.tid () != 0)
xsnprintf (buf, sizeof (buf), "Thread %d.0x%lx",
diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c
index 53b843b..8a20972 100644
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -914,7 +914,7 @@ win32_resume (struct thread_resume *resume_info, size_t n)
/* This handles the very limited set of resume packets that GDB can
currently produce. */
- if (n == 1 && ptid_equal (resume_info[0].thread, minus_one_ptid))
+ if (n == 1 && resume_info[0].thread == minus_one_ptid)
tid = -1;
else if (n > 1)
tid = -1;
@@ -923,7 +923,7 @@ win32_resume (struct thread_resume *resume_info, size_t n)
the Windows resume code do the right thing for thread switching. */
tid = current_event.dwThreadId;
- if (!ptid_equal (resume_info[0].thread, minus_one_ptid))
+ if (resume_info[0].thread != minus_one_ptid)
{
sig = gdb_signal_from_host (resume_info[0].sig);
step = resume_info[0].kind == resume_step;