Remove ptid_get_pid
This removes ptid_get_pid in favor of calling the ptid_t::pid method. gdb/ChangeLog 2018-07-03 Tom Tromey <tom@tromey.com> * common/ptid.c (ptid_get_pid): Remove. * common/ptid.h (ptid_get_pid): Don't declare. * aarch64-linux-nat.c: Update. * ada-lang.c: Update. * aix-thread.c: Update. * alpha-bsd-nat.c: Update. * amd64-fbsd-nat.c: Update. * amd64-linux-nat.c: Update. * arm-linux-nat.c: Update. * arm-nbsd-nat.c: Update. * auxv.c: Update. * break-catch-syscall.c: Update. * breakpoint.c: Update. * bsd-uthread.c: Update. * corelow.c: Update. * ctf.c: Update. * darwin-nat.c: Update. * fbsd-nat.c: Update. * fbsd-tdep.c: Update. * gcore.c: Update. * gnu-nat.c: Update. * hppa-nbsd-nat.c: Update. * hppa-obsd-nat.c: Update. * i386-fbsd-nat.c: Update. * ia64-linux-nat.c: Update. * inf-ptrace.c: Update. * infcmd.c: Update. * inferior.c: Update. * inferior.h: Update. * inflow.c: Update. * infrun.c: Update. * linux-fork.c: Update. * linux-nat.c: Update. * linux-tdep.c: Update. * linux-thread-db.c: Update. * m68k-bsd-nat.c: Update. * mi/mi-interp.c: Update. * mi/mi-main.c: Update. * mips-linux-nat.c: Update. * mips-nbsd-nat.c: Update. * mips64-obsd-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. * nto-procfs.c: Update. * obsd-nat.c: Update. * ppc-linux-nat.c: Update. * ppc-nbsd-nat.c: Update. * ppc-obsd-nat.c: Update. * proc-service.c: Update. * procfs.c: Update. * python/py-inferior.c: Update. * python/py-infthread.c: Update. * ravenscar-thread.c: Update. * record.c: Update. * remote-sim.c: Update. * remote.c: Update. * rs6000-nat.c: Update. * s390-linux-nat.c: Update. * sh-nbsd-nat.c: Update. * sol-thread.c: Update. * sparc-nat.c: Update. * sparc64-tdep.c: Update. * spu-linux-nat.c: Update. * spu-tdep.c: Update. * target-debug.h: Update. * target.c: Update. * thread.c: Update. * tid-parse.c: Update. * tracefile-tfile.c: Update. * vax-bsd-nat.c: Update. * windows-nat.c: Update. * x86-linux-nat.c: Update. * x86-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. * mem-break.c: Update. * nto-low.c: Update. * remote-utils.c: Update. * server.c: Update. * spu-low.c: Update. * target.c: Update. * tracepoint.c: Update.
This commit is contained in:
parent
f2907e4991
commit
e99b03dcf4
85 changed files with 518 additions and 437 deletions
|
@ -230,7 +230,7 @@ add_thread_db_info (void *handle)
|
|||
{
|
||||
struct thread_db_info *info = XCNEW (struct thread_db_info);
|
||||
|
||||
info->pid = ptid_get_pid (inferior_ptid);
|
||||
info->pid = inferior_ptid.pid ();
|
||||
info->handle = handle;
|
||||
|
||||
/* The workaround works by reading from /proc/pid/status, so it is
|
||||
|
@ -396,7 +396,7 @@ thread_from_lwp (thread_info *stopped, ptid_t ptid)
|
|||
LWP. */
|
||||
gdb_assert (ptid_get_lwp (ptid) != 0);
|
||||
|
||||
info = get_thread_db_info (ptid_get_pid (ptid));
|
||||
info = get_thread_db_info (ptid.pid ());
|
||||
|
||||
/* Access an lwp we know is stopped. */
|
||||
info->proc_handle.thread = stopped;
|
||||
|
@ -424,7 +424,7 @@ thread_db_notice_clone (ptid_t parent, ptid_t child)
|
|||
{
|
||||
struct thread_db_info *info;
|
||||
|
||||
info = get_thread_db_info (ptid_get_pid (child));
|
||||
info = get_thread_db_info (child.pid ());
|
||||
|
||||
if (info == NULL)
|
||||
return 0;
|
||||
|
@ -871,7 +871,7 @@ try_thread_db_load_1 (struct thread_db_info *info)
|
|||
td_ta_map_lwp2thr uses ps_get_thread_area, but we can't use that
|
||||
currently on core targets, as it uses ptrace directly. */
|
||||
if (target_has_execution
|
||||
&& linux_proc_task_list_dir_exists (ptid_get_pid (inferior_ptid)))
|
||||
&& linux_proc_task_list_dir_exists (inferior_ptid.pid ()))
|
||||
info->td_ta_thr_iter_p = NULL;
|
||||
else
|
||||
CHK (TDB_VERBOSE_DLSYM (info, td_ta_thr_iter));
|
||||
|
@ -890,13 +890,13 @@ try_thread_db_load_1 (struct thread_db_info *info)
|
|||
if (info->td_ta_thr_iter_p == NULL)
|
||||
{
|
||||
struct lwp_info *lp;
|
||||
int pid = ptid_get_pid (inferior_ptid);
|
||||
int pid = inferior_ptid.pid ();
|
||||
thread_info *curr_thread = inferior_thread ();
|
||||
|
||||
linux_stop_and_wait_all_lwps ();
|
||||
|
||||
ALL_LWPS (lp)
|
||||
if (ptid_get_pid (lp->ptid) == pid)
|
||||
if (lp->ptid.pid () == pid)
|
||||
thread_from_lwp (curr_thread, lp->ptid);
|
||||
|
||||
linux_unstop_all_lwps ();
|
||||
|
@ -1003,7 +1003,7 @@ try_thread_db_load (const char *library, int check_auto_load_safe)
|
|||
return 1;
|
||||
|
||||
/* This library "refused" to work on current inferior. */
|
||||
delete_thread_db_info (ptid_get_pid (inferior_ptid));
|
||||
delete_thread_db_info (inferior_ptid.pid ());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1175,7 +1175,7 @@ thread_db_load (void)
|
|||
{
|
||||
struct thread_db_info *info;
|
||||
|
||||
info = get_thread_db_info (ptid_get_pid (inferior_ptid));
|
||||
info = get_thread_db_info (inferior_ptid.pid ());
|
||||
|
||||
if (info != NULL)
|
||||
return 1;
|
||||
|
@ -1284,7 +1284,7 @@ check_pid_namespace_match (void)
|
|||
child's thread list, we'll mistakenly think it has no threads
|
||||
since the thread PID fields won't match the PID we give to
|
||||
libthread_db. */
|
||||
if (!linux_ns_same (ptid_get_pid (inferior_ptid), LINUX_NS_PID))
|
||||
if (!linux_ns_same (inferior_ptid.pid (), LINUX_NS_PID))
|
||||
{
|
||||
warning (_ ("Target and debugger are in different PID "
|
||||
"namespaces; thread lists and other data are "
|
||||
|
@ -1384,7 +1384,7 @@ thread_db_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
|
|||
return ptid;
|
||||
}
|
||||
|
||||
info = get_thread_db_info (ptid_get_pid (ptid));
|
||||
info = get_thread_db_info (ptid.pid ());
|
||||
|
||||
/* If this process isn't using thread_db, we're done. */
|
||||
if (info == NULL)
|
||||
|
@ -1394,7 +1394,7 @@ thread_db_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
|
|||
{
|
||||
/* New image, it may or may not end up using thread_db. Assume
|
||||
not unless we find otherwise. */
|
||||
delete_thread_db_info (ptid_get_pid (ptid));
|
||||
delete_thread_db_info (ptid.pid ());
|
||||
if (!thread_db_list)
|
||||
unpush_target (&the_thread_db_target);
|
||||
|
||||
|
@ -1410,7 +1410,7 @@ thread_db_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
|
|||
void
|
||||
thread_db_target::mourn_inferior ()
|
||||
{
|
||||
delete_thread_db_info (ptid_get_pid (inferior_ptid));
|
||||
delete_thread_db_info (inferior_ptid.pid ());
|
||||
|
||||
beneath ()->mourn_inferior ();
|
||||
|
||||
|
@ -1716,7 +1716,7 @@ thread_db_target::get_thread_local_address (ptid_t ptid,
|
|||
{
|
||||
td_err_e err;
|
||||
psaddr_t address;
|
||||
thread_db_info *info = get_thread_db_info (ptid_get_pid (ptid));
|
||||
thread_db_info *info = get_thread_db_info (ptid.pid ());
|
||||
thread_db_thread_info *priv = get_thread_db_thread_info (thread_info);
|
||||
|
||||
/* Finally, get the address of the variable. */
|
||||
|
@ -1784,7 +1784,7 @@ ptid_t
|
|||
thread_db_target::get_ada_task_ptid (long lwp, long thread)
|
||||
{
|
||||
/* NPTL uses a 1:1 model, so the LWP id suffices. */
|
||||
return ptid_t (ptid_get_pid (inferior_ptid), lwp, 0);
|
||||
return ptid_t (inferior_ptid.pid (), lwp, 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1793,9 +1793,9 @@ thread_db_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
|
|||
struct thread_db_info *info;
|
||||
|
||||
if (ptid_equal (ptid, minus_one_ptid))
|
||||
info = get_thread_db_info (ptid_get_pid (inferior_ptid));
|
||||
info = get_thread_db_info (inferior_ptid.pid ());
|
||||
else
|
||||
info = get_thread_db_info (ptid_get_pid (ptid));
|
||||
info = get_thread_db_info (ptid.pid ());
|
||||
|
||||
/* This workaround is only needed for child fork lwps stopped in a
|
||||
PTRACE_O_TRACEFORK event. When the inferior is resumed, the
|
||||
|
@ -1923,7 +1923,7 @@ info_auto_load_libthread_db (const char *args, int from_tty)
|
|||
static void
|
||||
maintenance_check_libthread_db (const char *args, int from_tty)
|
||||
{
|
||||
int inferior_pid = ptid_get_pid (inferior_ptid);
|
||||
int inferior_pid = inferior_ptid.pid ();
|
||||
struct thread_db_info *info;
|
||||
|
||||
if (inferior_pid == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue