aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-06-11 12:10:09 -0600
committerTom Tromey <tom@tromey.com>2018-07-03 11:36:43 -0600
commite38504b39279fa86cbb2c4a45ab8ec34e3aef90b (patch)
tree16f941e0132d751ed93e793e8ac078418f656938 /gdb/gdbserver
parente99b03dcf42606425eab8bd12eadb8aa4007f35a (diff)
downloadbinutils-e38504b39279fa86cbb2c4a45ab8ec34e3aef90b.zip
binutils-e38504b39279fa86cbb2c4a45ab8ec34e3aef90b.tar.gz
binutils-e38504b39279fa86cbb2c4a45ab8ec34e3aef90b.tar.bz2
Remove ptid_get_lwp
This removes ptid_get_lwp in favor of calling the ptid_t::lwp method. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_get_lwp): Remove. * common/ptid.h (ptid_get_lwp): Don't declare. * aarch64-linux-nat.c: Update. * ada-tasks.c: Update. * aix-thread.c: Update. * amd64-linux-nat.c: Update. * arm-linux-nat.c: Update. * corelow.c: Update. * fbsd-nat.c: Update. * fbsd-tdep.c: Update. * gnu-nat.c: Update. * i386-cygwin-tdep.c: Update. * i386-gnu-nat.c: Update. * i386-linux-nat.c: Update. * ia64-linux-nat.c: Update. * inf-ptrace.c: Update. * infrun.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * linux-tdep.c: Update. * linux-thread-db.c: Update. * mips-linux-nat.c: Update. * nat/aarch64-linux-hw-point.c: Update. * nat/aarch64-linux.c: Update. * nat/linux-btrace.c: Update. * nat/linux-osdata.c: Update. * nat/linux-procfs.c: Update. * nat/x86-linux-dregs.c: Update. * obsd-nat.c: Update. * ppc-fbsd-nat.c: Update. * ppc-linux-nat.c: Update. * procfs.c: Update. * python/py-infthread.c: Update. * ravenscar-thread.c: Update. * remote.c: Update. * s390-linux-nat.c: Update. * sol-thread.c: Update. * sol2-tdep.c: Update. * spu-linux-nat.c: Update. * x86-linux-nat.c: Update. * xtensa-linux-nat.c: Update. gdb/gdbserver/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * linux-low.c: Update. * linux-mips-low.c: Update. * lynx-low.c: Update. * nto-low.c: Update. * remote-utils.c: Update. * server.c: Update. * spu-low.c: Update. * target.c: Update. * thread-db.c: Update.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog12
-rw-r--r--gdb/gdbserver/linux-low.c10
-rw-r--r--gdb/gdbserver/linux-mips-low.c2
-rw-r--r--gdb/gdbserver/lynx-low.c2
-rw-r--r--gdb/gdbserver/nto-low.c10
-rw-r--r--gdb/gdbserver/remote-utils.c2
-rw-r--r--gdb/gdbserver/server.c2
-rw-r--r--gdb/gdbserver/spu-low.c10
-rw-r--r--gdb/gdbserver/target.c4
-rw-r--r--gdb/gdbserver/thread-db.c2
10 files changed, 34 insertions, 22 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 5aee98c..602d4f1 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -3,6 +3,18 @@
* linux-low.c: Update.
* linux-mips-low.c: Update.
* lynx-low.c: Update.
+ * nto-low.c: Update.
+ * remote-utils.c: Update.
+ * server.c: Update.
+ * spu-low.c: Update.
+ * target.c: Update.
+ * thread-db.c: Update.
+
+2018-07-03 Tom Tromey <tom@tromey.com>
+
+ * linux-low.c: Update.
+ * linux-mips-low.c: Update.
+ * lynx-low.c: Update.
* mem-break.c: Update.
* nto-low.c: Update.
* remote-utils.c: Update.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 99a7e16..a290b5b 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -529,7 +529,7 @@ handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
{
debug_printf ("HEW: Got fork event from LWP %ld, "
"new child is %d\n",
- ptid_get_lwp (ptid_of (event_thr)),
+ ptid_of (event_thr).lwp (),
ptid.pid ());
}
@@ -1052,7 +1052,7 @@ int
linux_attach_lwp (ptid_t ptid)
{
struct lwp_info *new_lwp;
- int lwpid = ptid_get_lwp (ptid);
+ int lwpid = ptid.lwp ();
if (ptrace (PTRACE_ATTACH, lwpid, (PTRACE_TYPE_ARG3) 0, (PTRACE_TYPE_ARG4) 0)
!= 0)
@@ -1140,7 +1140,7 @@ attach_proc_task_lwp_callback (ptid_t ptid)
/* Is this a new thread? */
if (find_thread_ptid (ptid) == NULL)
{
- int lwpid = ptid_get_lwp (ptid);
+ int lwpid = ptid.lwp ();
int err;
if (debug_threads)
@@ -1324,7 +1324,7 @@ kill_wait_lwp (struct lwp_info *lwp)
{
struct thread_info *thr = get_lwp_thread (lwp);
int pid = ptid_of (thr).pid ();
- int lwpid = ptid_get_lwp (ptid_of (thr));
+ int lwpid = ptid_of (thr).lwp ();
int wstat;
int res;
@@ -4548,7 +4548,7 @@ linux_set_resume_request (thread_info *thread, thread_resume *resume, size_t n)
of PID'. */
|| (ptid.pid () == pid_of (thread)
&& (ptid_is_pid (ptid)
- || ptid_get_lwp (ptid) == -1)))
+ || ptid.lwp () == -1)))
{
if (resume[ndx].kind == resume_stop
&& thread->last_resume_kind == resume_stop)
diff --git a/gdb/gdbserver/linux-mips-low.c b/gdb/gdbserver/linux-mips-low.c
index f61c294..2194af6 100644
--- a/gdb/gdbserver/linux-mips-low.c
+++ b/gdb/gdbserver/linux-mips-low.c
@@ -450,7 +450,7 @@ mips_linux_prepare_to_resume (struct lwp_info *lwp)
if (mips_linux_watch_get_num_valid (&priv->watch_mirror) > 0)
{
/* Write the mirrored watch register values. */
- int tid = ptid_get_lwp (ptid);
+ int tid = ptid.lwp ();
if (-1 == ptrace (PTRACE_SET_WATCH_REGS, tid,
&priv->watch_mirror, NULL))
diff --git a/gdb/gdbserver/lynx-low.c b/gdb/gdbserver/lynx-low.c
index b637ef9..8d79ab1 100644
--- a/gdb/gdbserver/lynx-low.c
+++ b/gdb/gdbserver/lynx-low.c
@@ -93,7 +93,7 @@ lynx_ptid_get_tid (ptid_t ptid)
{
/* See lynx_ptid_t: The LynxOS tid is stored inside the lwp field
of the ptid. */
- return ptid_get_lwp (ptid);
+ return ptid.lwp ();
}
/* For a given PTID, return the associated PID as known by the LynxOS
diff --git a/gdb/gdbserver/nto-low.c b/gdb/gdbserver/nto-low.c
index 6a05d2b..21f6da6 100644
--- a/gdb/gdbserver/nto-low.c
+++ b/gdb/gdbserver/nto-low.c
@@ -92,12 +92,12 @@ nto_set_thread (ptid_t ptid)
int res = 0;
TRACE ("%s pid: %d tid: %ld\n", __func__, ptid.pid (),
- ptid_get_lwp (ptid));
+ ptid.lwp ());
if (nto_inferior.ctl_fd != -1
&& !ptid_equal (ptid, null_ptid)
&& !ptid_equal (ptid, minus_one_ptid))
{
- pthread_t tid = ptid_get_lwp (ptid);
+ pthread_t tid = ptid.lwp ();
if (EOK == devctl (nto_inferior.ctl_fd, DCMD_PROC_CURTHREAD, &tid,
sizeof (tid), 0))
@@ -213,7 +213,7 @@ do_attach (pid_t pid)
proc = add_process (status.pid, 1);
proc->tdesc = nto_tdesc;
TRACE ("Adding thread: pid=%d tid=%ld\n", status.pid,
- ptid_get_lwp (ptid));
+ ptid.lwp ());
nto_find_new_threads (&nto_inferior);
}
else
@@ -431,8 +431,8 @@ nto_thread_alive (ptid_t ptid)
int res;
TRACE ("%s pid:%d tid:%d\n", __func__, ptid.pid (),
- ptid_get_lwp (ptid));
- if (SignalKill (0, ptid.pid (), ptid_get_lwp (ptid),
+ ptid.lwp ());
+ if (SignalKill (0, ptid.pid (), ptid.lwp (),
0, 0, 0) == -1)
res = 0;
else
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 400c2be..ac57ce5 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -492,7 +492,7 @@ write_ptid (char *buf, ptid_t ptid)
else
buf += sprintf (buf, "p%x.", pid);
}
- tid = ptid_get_lwp (ptid);
+ tid = ptid.lwp ();
if (tid < 0)
buf += sprintf (buf, "-%x", -tid);
else
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 28bc9de..5c24315 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -2700,7 +2700,7 @@ visit_actioned_threads (thread_info *thread,
|| ptid_equal (action->thread, thread->id)
|| ((action->thread.pid ()
== thread->id.pid ())
- && ptid_get_lwp (action->thread) == -1))
+ && action->thread.lwp () == -1))
{
if ((*callback) (action, thread))
return true;
diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c
index 3436d39..b3980e7 100644
--- a/gdb/gdbserver/spu-low.c
+++ b/gdb/gdbserver/spu-low.c
@@ -66,7 +66,7 @@ fetch_ppc_register (int regno)
{
PTRACE_TYPE_RET res;
- int tid = ptid_get_lwp (current_ptid);
+ int tid = current_ptid.lwp ();
#ifndef __powerpc64__
/* If running as a 32-bit process on a 64-bit system, we attempt
@@ -151,7 +151,7 @@ fetch_ppc_memory (CORE_ADDR memaddr, char *myaddr, int len)
/ sizeof (PTRACE_TYPE_RET));
PTRACE_TYPE_RET *buffer;
- int tid = ptid_get_lwp (current_ptid);
+ int tid = current_ptid.lwp ();
buffer = XALLOCAVEC (PTRACE_TYPE_RET, count);
for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET))
@@ -176,7 +176,7 @@ store_ppc_memory (CORE_ADDR memaddr, char *myaddr, int len)
/ sizeof (PTRACE_TYPE_RET));
PTRACE_TYPE_RET *buffer;
- int tid = ptid_get_lwp (current_ptid);
+ int tid = current_ptid.lwp ();
buffer = XALLOCAVEC (PTRACE_TYPE_RET, count);
@@ -241,7 +241,7 @@ spu_proc_xfer_spu (const char *annex, unsigned char *readbuf,
if (!annex)
return 0;
- sprintf (buf, "/proc/%ld/fd/%s", ptid_get_lwp (current_ptid), annex);
+ sprintf (buf, "/proc/%ld/fd/%s", current_ptid.lwp (), annex);
fd = open (buf, writebuf? O_WRONLY : O_RDONLY);
if (fd <= 0)
return -1;
@@ -409,7 +409,7 @@ spu_resume (struct thread_resume *resume_info, size_t n)
regcache_invalidate ();
errno = 0;
- ptrace (PTRACE_CONT, ptid_get_lwp (ptid_of (thr)), 0, resume_info[i].sig);
+ ptrace (PTRACE_CONT, ptid_of (thr).lwp (), 0, resume_info[i].sig);
if (errno)
perror_with_name ("ptrace");
}
diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
index 400d458..aff316d 100644
--- a/gdb/gdbserver/target.c
+++ b/gdb/gdbserver/target.c
@@ -321,9 +321,9 @@ target_pid_to_str (ptid_t ptid)
else if (ptid_get_tid (ptid) != 0)
xsnprintf (buf, sizeof (buf), "Thread %d.0x%lx",
ptid.pid (), ptid_get_tid (ptid));
- else if (ptid_get_lwp (ptid) != 0)
+ else if (ptid.lwp () != 0)
xsnprintf (buf, sizeof (buf), "LWP %d.%ld",
- ptid.pid (), ptid_get_lwp (ptid));
+ ptid.pid (), ptid.lwp ());
else
xsnprintf (buf, sizeof (buf), "Process %d",
ptid.pid ());
diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c
index 80125ee..7d4bfb6 100644
--- a/gdb/gdbserver/thread-db.c
+++ b/gdb/gdbserver/thread-db.c
@@ -167,7 +167,7 @@ find_one_thread (ptid_t ptid)
td_err_e err;
struct lwp_info *lwp;
struct thread_db *thread_db = current_process ()->priv->thread_db;
- int lwpid = ptid_get_lwp (ptid);
+ int lwpid = ptid.lwp ();
thread_info *thread = find_thread_ptid (ptid);
lwp = get_thread_lwp (thread);