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:
Tom Tromey 2018-06-11 12:05:27 -06:00
parent f2907e4991
commit e99b03dcf4
85 changed files with 518 additions and 437 deletions

View File

@ -1,3 +1,83 @@
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.
2018-07-03 Tom Tromey <tom@tromey.com> 2018-07-03 Tom Tromey <tom@tromey.com>
* common/ptid.c (pid_to_ptid): Remove. * common/ptid.c (pid_to_ptid): Remove.

View File

@ -540,7 +540,7 @@ aarch64_linux_nat_target::low_new_fork (struct lwp_info *parent,
new process so that all breakpoints and watchpoints can be new process so that all breakpoints and watchpoints can be
removed together. */ removed together. */
parent_pid = ptid_get_pid (parent->ptid); parent_pid = parent->ptid.pid ();
parent_state = aarch64_get_debug_reg_state (parent_pid); parent_state = aarch64_get_debug_reg_state (parent_pid);
child_state = aarch64_get_debug_reg_state (child_pid); child_state = aarch64_get_debug_reg_state (child_pid);
*child_state = *parent_state; *child_state = *parent_state;
@ -566,8 +566,8 @@ ps_get_thread_area (struct ps_prochandle *ph,
void void
aarch64_linux_nat_target::post_startup_inferior (ptid_t ptid) aarch64_linux_nat_target::post_startup_inferior (ptid_t ptid)
{ {
low_forget_process (ptid_get_pid (ptid)); low_forget_process (ptid.pid ());
aarch64_linux_get_debug_reg_capacity (ptid_get_pid (ptid)); aarch64_linux_get_debug_reg_capacity (ptid.pid ());
linux_nat_target::post_startup_inferior (ptid); linux_nat_target::post_startup_inferior (ptid);
} }
@ -687,7 +687,7 @@ aarch64_linux_nat_target::insert_hw_breakpoint (struct gdbarch *gdbarch,
int len; int len;
const enum target_hw_bp_type type = hw_execute; const enum target_hw_bp_type type = hw_execute;
struct aarch64_debug_reg_state *state struct aarch64_debug_reg_state *state
= aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid)); = aarch64_get_debug_reg_state (inferior_ptid.pid ());
gdbarch_breakpoint_from_pc (gdbarch, &addr, &len); gdbarch_breakpoint_from_pc (gdbarch, &addr, &len);
@ -720,7 +720,7 @@ aarch64_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch,
int len = 4; int len = 4;
const enum target_hw_bp_type type = hw_execute; const enum target_hw_bp_type type = hw_execute;
struct aarch64_debug_reg_state *state struct aarch64_debug_reg_state *state
= aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid)); = aarch64_get_debug_reg_state (inferior_ptid.pid ());
gdbarch_breakpoint_from_pc (gdbarch, &addr, &len); gdbarch_breakpoint_from_pc (gdbarch, &addr, &len);
@ -753,7 +753,7 @@ aarch64_linux_nat_target::insert_watchpoint (CORE_ADDR addr, int len,
{ {
int ret; int ret;
struct aarch64_debug_reg_state *state struct aarch64_debug_reg_state *state
= aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid)); = aarch64_get_debug_reg_state (inferior_ptid.pid ());
if (show_debug_regs) if (show_debug_regs)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
@ -785,7 +785,7 @@ aarch64_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len,
{ {
int ret; int ret;
struct aarch64_debug_reg_state *state struct aarch64_debug_reg_state *state
= aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid)); = aarch64_get_debug_reg_state (inferior_ptid.pid ());
if (show_debug_regs) if (show_debug_regs)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
@ -831,7 +831,7 @@ aarch64_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
return false; return false;
/* Check if the address matches any watched address. */ /* Check if the address matches any watched address. */
state = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid)); state = aarch64_get_debug_reg_state (inferior_ptid.pid ());
for (i = aarch64_num_wp_regs - 1; i >= 0; --i) for (i = aarch64_num_wp_regs - 1; i >= 0; --i)
{ {
const unsigned int offset const unsigned int offset

View File

@ -12108,7 +12108,7 @@ ada_exception_support_info_sniffer (void)
loaded. If it is not started, this may mean that the symbol is loaded. If it is not started, this may mean that the symbol is
in a shared library. */ in a shared library. */
if (ptid_get_pid (inferior_ptid) == 0) if (inferior_ptid.pid () == 0)
error (_("Unable to insert catchpoint. Try to start the program first.")); error (_("Unable to insert catchpoint. Try to start the program first."));
/* At this point, we know that we are debugging an Ada program and /* At this point, we know that we are debugging an Ada program and

View File

@ -325,7 +325,7 @@ pid_to_prc (ptid_t *ptidp)
ptid = *ptidp; ptid = *ptidp;
if (PD_TID (ptid)) if (PD_TID (ptid))
*ptidp = ptid_t (ptid_get_pid (ptid)); *ptidp = ptid_t (ptid.pid ());
} }
/* pthdb callback: for <i> from 0 to COUNT, set SYMBOLS[<i>].addr to /* pthdb callback: for <i> from 0 to COUNT, set SYMBOLS[<i>].addr to
@ -673,9 +673,9 @@ ptid_cmp (ptid_t ptid1, ptid_t ptid2)
{ {
int pid1, pid2; int pid1, pid2;
if (ptid_get_pid (ptid1) < ptid_get_pid (ptid2)) if (ptid1.pid () < ptid2.pid ())
return -1; return -1;
else if (ptid_get_pid (ptid1) > ptid_get_pid (ptid2)) else if (ptid1.pid () > ptid2.pid ())
return 1; return 1;
else if (ptid_get_tid (ptid1) < ptid_get_tid (ptid2)) else if (ptid_get_tid (ptid1) < ptid_get_tid (ptid2))
return -1; return -1;
@ -712,7 +712,7 @@ get_signaled_thread (void)
while (1) while (1)
{ {
if (getthrds (ptid_get_pid (inferior_ptid), &thrinf, if (getthrds (inferior_ptid.pid (), &thrinf,
sizeof (thrinf), &ktid, 1) != 1) sizeof (thrinf), &ktid, 1) != 1)
break; break;
@ -795,7 +795,7 @@ sync_threadlists (void)
/* Apply differences between the two arrays to GDB's thread list. */ /* Apply differences between the two arrays to GDB's thread list. */
infpid = ptid_get_pid (inferior_ptid); infpid = inferior_ptid.pid ();
for (pi = gi = 0; pi < pcount || gi < gcount;) for (pi = gi = 0; pi < pcount || gi < gcount;)
{ {
if (pi == pcount) if (pi == pcount)
@ -1042,7 +1042,7 @@ aix_thread_target::resume (ptid_t ptid, int step, enum gdb_signal sig)
{ {
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid); scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
inferior_ptid = ptid_t (ptid_get_pid (inferior_ptid)); inferior_ptid = ptid_t (inferior_ptid.pid ());
beneath ()->resume (ptid, step, sig); beneath ()->resume (ptid, step, sig);
} }
else else
@ -1082,11 +1082,11 @@ aix_thread_target::wait (ptid_t ptid, struct target_waitstatus *status,
pid_to_prc (&ptid); pid_to_prc (&ptid);
inferior_ptid = ptid_t (ptid_get_pid (inferior_ptid)); inferior_ptid = ptid_t (inferior_ptid.pid ());
ptid = beneath ()->wait (ptid, status, options); ptid = beneath ()->wait (ptid, status, options);
} }
if (ptid_get_pid (ptid) == -1) if (ptid.pid () == -1)
return ptid_t (-1); return ptid_t (-1);
/* Check whether libpthdebug might be ready to be initialized. */ /* Check whether libpthdebug might be ready to be initialized. */
@ -1722,7 +1722,7 @@ aix_thread_target::xfer_partial (enum target_object object,
{ {
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid); scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
inferior_ptid = ptid_t (ptid_get_pid (inferior_ptid)); inferior_ptid = ptid_t (inferior_ptid.pid ());
return beneath ()->xfer_partial (object, annex, readbuf, return beneath ()->xfer_partial (object, annex, readbuf,
writebuf, offset, len, xfered_len); writebuf, offset, len, xfered_len);
} }
@ -1832,7 +1832,7 @@ aix_thread_target::extra_thread_info (struct thread_info *thread)
ptid_t ptid_t
aix_thread_target::get_ada_task_ptid (long lwp, long thread) aix_thread_target::get_ada_task_ptid (long lwp, long thread)
{ {
return ptid_t (ptid_get_pid (inferior_ptid), 0, thread); return ptid_t (inferior_ptid.pid (), 0, thread);
} }

View File

@ -98,7 +98,7 @@ alpha_bsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{ {
struct reg gregs; struct reg gregs;
if (ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()), if (ptrace (PT_GETREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &gregs, 0) == -1) (PTRACE_TYPE_ARG3) &gregs, 0) == -1)
perror_with_name (_("Couldn't get registers")); perror_with_name (_("Couldn't get registers"));
@ -112,7 +112,7 @@ alpha_bsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{ {
struct fpreg fpregs; struct fpreg fpregs;
if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()), if (ptrace (PT_GETFPREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1) (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status")); perror_with_name (_("Couldn't get floating point status"));
@ -129,13 +129,13 @@ alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno)
if (regno == -1 || getregs_supplies (regno)) if (regno == -1 || getregs_supplies (regno))
{ {
struct reg gregs; struct reg gregs;
if (ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()), if (ptrace (PT_GETREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &gregs, 0) == -1) (PTRACE_TYPE_ARG3) &gregs, 0) == -1)
perror_with_name (_("Couldn't get registers")); perror_with_name (_("Couldn't get registers"));
alphabsd_fill_reg (regcache, (char *) &gregs, regno); alphabsd_fill_reg (regcache, (char *) &gregs, regno);
if (ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()), if (ptrace (PT_SETREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &gregs, 0) == -1) (PTRACE_TYPE_ARG3) &gregs, 0) == -1)
perror_with_name (_("Couldn't write registers")); perror_with_name (_("Couldn't write registers"));
@ -148,13 +148,13 @@ alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno)
{ {
struct fpreg fpregs; struct fpreg fpregs;
if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()), if (ptrace (PT_GETFPREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1) (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status")); perror_with_name (_("Couldn't get floating point status"));
alphabsd_fill_fpreg (regcache, (char *) &fpregs, regno); alphabsd_fill_fpreg (regcache, (char *) &fpregs, regno);
if (ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()), if (ptrace (PT_SETFPREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1) (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't write floating point status")); perror_with_name (_("Couldn't write floating point status"));
} }

View File

@ -167,7 +167,7 @@ amd64_fbsd_nat_target::read_description ()
struct reg regs; struct reg regs;
int is64; int is64;
if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), if (ptrace (PT_GETREGS, inferior_ptid.pid (),
(PTRACE_TYPE_ARG3) &regs, 0) == -1) (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers")); perror_with_name (_("Couldn't get registers"));
is64 = (regs.r_cs == GSEL (GUCODE_SEL, SEL_UPL)); is64 = (regs.r_cs == GSEL (GUCODE_SEL, SEL_UPL));
@ -176,7 +176,7 @@ amd64_fbsd_nat_target::read_description ()
{ {
struct ptrace_xstate_info info; struct ptrace_xstate_info info;
if (ptrace (PT_GETXSTATE_INFO, ptid_get_pid (inferior_ptid), if (ptrace (PT_GETXSTATE_INFO, inferior_ptid.pid (),
(PTRACE_TYPE_ARG3) &info, sizeof (info)) == 0) (PTRACE_TYPE_ARG3) &info, sizeof (info)) == 0)
{ {
x86bsd_xsave_len = info.xsave_len; x86bsd_xsave_len = info.xsave_len;

View File

@ -150,7 +150,7 @@ amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
/* GNU/Linux LWP ID's are process ID's. */ /* GNU/Linux LWP ID's are process ID's. */
tid = ptid_get_lwp (regcache->ptid ()); tid = ptid_get_lwp (regcache->ptid ());
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (regcache->ptid ()); /* Not a threaded program. */ tid = regcache->ptid ().pid (); /* Not a threaded program. */
if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum)) if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
{ {
@ -228,7 +228,7 @@ amd64_linux_nat_target::store_registers (struct regcache *regcache, int regnum)
/* GNU/Linux LWP ID's are process ID's. */ /* GNU/Linux LWP ID's are process ID's. */
tid = ptid_get_lwp (regcache->ptid ()); tid = ptid_get_lwp (regcache->ptid ());
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (regcache->ptid ()); /* Not a threaded program. */ tid = regcache->ptid ().pid (); /* Not a threaded program. */
if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum)) if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
{ {

View File

@ -993,7 +993,7 @@ arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt,
struct arm_linux_hw_breakpoint* bpts; struct arm_linux_hw_breakpoint* bpts;
struct update_registers_data data; struct update_registers_data data;
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
pid_ptid = ptid_t (pid); pid_ptid = ptid_t (pid);
if (watchpoint) if (watchpoint)
@ -1032,7 +1032,7 @@ arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt,
struct arm_linux_hw_breakpoint* bpts; struct arm_linux_hw_breakpoint* bpts;
struct update_registers_data data; struct update_registers_data data;
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
pid_ptid = ptid_t (pid); pid_ptid = ptid_t (pid);
if (watchpoint) if (watchpoint)
@ -1251,8 +1251,8 @@ arm_linux_nat_target::low_prepare_to_resume (struct lwp_info *lwp)
struct arch_lwp_info *arm_lwp_info = lwp->arch_private; struct arch_lwp_info *arm_lwp_info = lwp->arch_private;
pid = ptid_get_lwp (lwp->ptid); pid = ptid_get_lwp (lwp->ptid);
bpts = arm_linux_get_debug_reg_state (ptid_get_pid (lwp->ptid))->bpts; bpts = arm_linux_get_debug_reg_state (lwp->ptid.pid ())->bpts;
wpts = arm_linux_get_debug_reg_state (ptid_get_pid (lwp->ptid))->wpts; wpts = arm_linux_get_debug_reg_state (lwp->ptid.pid ())->wpts;
/* NULL means this is the main thread still going through the shell, /* NULL means this is the main thread still going through the shell,
or, no watchpoint has been set yet. In that case, there's or, no watchpoint has been set yet. In that case, there's
@ -1315,7 +1315,7 @@ arm_linux_nat_target::low_new_fork (struct lwp_info *parent, pid_t child_pid)
new process so that all breakpoints and watchpoints can be new process so that all breakpoints and watchpoints can be
removed together. */ removed together. */
parent_pid = ptid_get_pid (parent->ptid); parent_pid = parent->ptid.pid ();
parent_state = arm_linux_get_debug_reg_state (parent_pid); parent_state = arm_linux_get_debug_reg_state (parent_pid);
child_state = arm_linux_get_debug_reg_state (child_pid); child_state = arm_linux_get_debug_reg_state (child_pid);
*child_state = *parent_state; *child_state = *parent_state;

View File

@ -82,7 +82,7 @@ fetch_register (struct regcache *regcache, int regno)
struct reg inferior_registers; struct reg inferior_registers;
int ret; int ret;
ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()), ret = ptrace (PT_GETREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &inferior_registers, 0); (PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0) if (ret < 0)
@ -131,7 +131,7 @@ fetch_regs (struct regcache *regcache)
int ret; int ret;
int regno; int regno;
ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()), ret = ptrace (PT_GETREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &inferior_registers, 0); (PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0) if (ret < 0)
@ -149,7 +149,7 @@ fetch_fp_register (struct regcache *regcache, int regno)
struct fpreg inferior_fp_registers; struct fpreg inferior_fp_registers;
int ret; int ret;
ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()), ret = ptrace (PT_GETFPREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0) if (ret < 0)
@ -179,7 +179,7 @@ fetch_fp_regs (struct regcache *regcache)
int ret; int ret;
int regno; int regno;
ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()), ret = ptrace (PT_GETFPREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0) if (ret < 0)
@ -216,7 +216,7 @@ store_register (const struct regcache *regcache, int regno)
struct reg inferior_registers; struct reg inferior_registers;
int ret; int ret;
ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()), ret = ptrace (PT_GETREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &inferior_registers, 0); (PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0) if (ret < 0)
@ -274,7 +274,7 @@ store_register (const struct regcache *regcache, int regno)
break; break;
} }
ret = ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()), ret = ptrace (PT_SETREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &inferior_registers, 0); (PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0) if (ret < 0)
@ -316,7 +316,7 @@ store_regs (const struct regcache *regcache)
inferior_registers.r_pc = pc_val | psr_val; inferior_registers.r_pc = pc_val | psr_val;
} }
ret = ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()), ret = ptrace (PT_SETREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &inferior_registers, 0); (PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0) if (ret < 0)
@ -329,7 +329,7 @@ store_fp_register (const struct regcache *regcache, int regno)
struct fpreg inferior_fp_registers; struct fpreg inferior_fp_registers;
int ret; int ret;
ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()), ret = ptrace (PT_GETFPREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0) if (ret < 0)
@ -351,7 +351,7 @@ store_fp_register (const struct regcache *regcache, int regno)
break; break;
} }
ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()), ret = ptrace (PT_SETFPREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0) if (ret < 0)
@ -373,7 +373,7 @@ store_fp_regs (const struct regcache *regcache)
regcache->raw_collect (ARM_FPS_REGNUM, regcache->raw_collect (ARM_FPS_REGNUM,
(char *) &inferior_fp_registers.fpr_fpsr); (char *) &inferior_fp_registers.fpr_fpsr);
ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()), ret = ptrace (PT_SETFPREGS, regcache->ptid ().pid (),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0); (PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0) if (ret < 0)

View File

@ -50,7 +50,7 @@ procfs_xfer_auxv (gdb_byte *readbuf,
int fd; int fd;
ssize_t l; ssize_t l;
pathname = xstrprintf ("/proc/%d/auxv", ptid_get_pid (inferior_ptid)); pathname = xstrprintf ("/proc/%d/auxv", inferior_ptid.pid ());
fd = gdb_open_cloexec (pathname, writebuf != NULL ? O_WRONLY : O_RDONLY, 0); fd = gdb_open_cloexec (pathname, writebuf != NULL ? O_WRONLY : O_RDONLY, 0);
xfree (pathname); xfree (pathname);
if (fd < 0) if (fd < 0)

View File

@ -110,7 +110,7 @@ insert_catch_syscall (struct bp_location *bl)
} }
} }
return target_set_syscall_catchpoint (ptid_get_pid (inferior_ptid), return target_set_syscall_catchpoint (inferior_ptid.pid (),
inf_data->total_syscalls_count != 0, inf_data->total_syscalls_count != 0,
inf_data->any_syscall_count, inf_data->any_syscall_count,
inf_data->syscalls_counts); inf_data->syscalls_counts);
@ -141,7 +141,7 @@ remove_catch_syscall (struct bp_location *bl, enum remove_bp_reason reason)
} }
} }
return target_set_syscall_catchpoint (ptid_get_pid (inferior_ptid), return target_set_syscall_catchpoint (inferior_ptid.pid (),
inf_data->total_syscalls_count != 0, inf_data->total_syscalls_count != 0,
inf_data->any_syscall_count, inf_data->any_syscall_count,
inf_data->syscalls_counts); inf_data->syscalls_counts);

View File

@ -3637,7 +3637,7 @@ detach_breakpoints (ptid_t ptid)
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid); scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
struct inferior *inf = current_inferior (); struct inferior *inf = current_inferior ();
if (ptid_get_pid (ptid) == ptid_get_pid (inferior_ptid)) if (ptid.pid () == inferior_ptid.pid ())
error (_("Cannot detach breakpoints of inferior_ptid")); error (_("Cannot detach breakpoints of inferior_ptid"));
/* Set inferior_ptid; remove_breakpoint_1 uses this global. */ /* Set inferior_ptid; remove_breakpoint_1 uses this global. */
@ -7709,7 +7709,7 @@ struct fork_catchpoint : public breakpoint
static int static int
insert_catch_fork (struct bp_location *bl) insert_catch_fork (struct bp_location *bl)
{ {
return target_insert_fork_catchpoint (ptid_get_pid (inferior_ptid)); return target_insert_fork_catchpoint (inferior_ptid.pid ());
} }
/* Implement the "remove" breakpoint_ops method for fork /* Implement the "remove" breakpoint_ops method for fork
@ -7718,7 +7718,7 @@ insert_catch_fork (struct bp_location *bl)
static int static int
remove_catch_fork (struct bp_location *bl, enum remove_bp_reason reason) remove_catch_fork (struct bp_location *bl, enum remove_bp_reason reason)
{ {
return target_remove_fork_catchpoint (ptid_get_pid (inferior_ptid)); return target_remove_fork_catchpoint (inferior_ptid.pid ());
} }
/* Implement the "breakpoint_hit" breakpoint_ops method for fork /* Implement the "breakpoint_hit" breakpoint_ops method for fork
@ -7761,7 +7761,7 @@ print_it_catch_fork (bpstat bs)
} }
uiout->field_int ("bkptno", b->number); uiout->field_int ("bkptno", b->number);
uiout->text (" (forked process "); uiout->text (" (forked process ");
uiout->field_int ("newpid", ptid_get_pid (c->forked_inferior_pid)); uiout->field_int ("newpid", c->forked_inferior_pid.pid ());
uiout->text ("), "); uiout->text ("), ");
return PRINT_SRC_AND_LOC; return PRINT_SRC_AND_LOC;
} }
@ -7788,7 +7788,7 @@ print_one_catch_fork (struct breakpoint *b, struct bp_location **last_loc)
if (!ptid_equal (c->forked_inferior_pid, null_ptid)) if (!ptid_equal (c->forked_inferior_pid, null_ptid))
{ {
uiout->text (", process "); uiout->text (", process ");
uiout->field_int ("what", ptid_get_pid (c->forked_inferior_pid)); uiout->field_int ("what", c->forked_inferior_pid.pid ());
uiout->spaces (1); uiout->spaces (1);
} }
@ -7825,7 +7825,7 @@ static struct breakpoint_ops catch_fork_breakpoint_ops;
static int static int
insert_catch_vfork (struct bp_location *bl) insert_catch_vfork (struct bp_location *bl)
{ {
return target_insert_vfork_catchpoint (ptid_get_pid (inferior_ptid)); return target_insert_vfork_catchpoint (inferior_ptid.pid ());
} }
/* Implement the "remove" breakpoint_ops method for vfork /* Implement the "remove" breakpoint_ops method for vfork
@ -7834,7 +7834,7 @@ insert_catch_vfork (struct bp_location *bl)
static int static int
remove_catch_vfork (struct bp_location *bl, enum remove_bp_reason reason) remove_catch_vfork (struct bp_location *bl, enum remove_bp_reason reason)
{ {
return target_remove_vfork_catchpoint (ptid_get_pid (inferior_ptid)); return target_remove_vfork_catchpoint (inferior_ptid.pid ());
} }
/* Implement the "breakpoint_hit" breakpoint_ops method for vfork /* Implement the "breakpoint_hit" breakpoint_ops method for vfork
@ -7877,7 +7877,7 @@ print_it_catch_vfork (bpstat bs)
} }
uiout->field_int ("bkptno", b->number); uiout->field_int ("bkptno", b->number);
uiout->text (" (vforked process "); uiout->text (" (vforked process ");
uiout->field_int ("newpid", ptid_get_pid (c->forked_inferior_pid)); uiout->field_int ("newpid", c->forked_inferior_pid.pid ());
uiout->text ("), "); uiout->text ("), ");
return PRINT_SRC_AND_LOC; return PRINT_SRC_AND_LOC;
} }
@ -7903,7 +7903,7 @@ print_one_catch_vfork (struct breakpoint *b, struct bp_location **last_loc)
if (!ptid_equal (c->forked_inferior_pid, null_ptid)) if (!ptid_equal (c->forked_inferior_pid, null_ptid))
{ {
uiout->text (", process "); uiout->text (", process ");
uiout->field_int ("what", ptid_get_pid (c->forked_inferior_pid)); uiout->field_int ("what", c->forked_inferior_pid.pid ());
uiout->spaces (1); uiout->spaces (1);
} }
@ -8254,13 +8254,13 @@ exec_catchpoint::~exec_catchpoint ()
static int static int
insert_catch_exec (struct bp_location *bl) insert_catch_exec (struct bp_location *bl)
{ {
return target_insert_exec_catchpoint (ptid_get_pid (inferior_ptid)); return target_insert_exec_catchpoint (inferior_ptid.pid ());
} }
static int static int
remove_catch_exec (struct bp_location *bl, enum remove_bp_reason reason) remove_catch_exec (struct bp_location *bl, enum remove_bp_reason reason)
{ {
return target_remove_exec_catchpoint (ptid_get_pid (inferior_ptid)); return target_remove_exec_catchpoint (inferior_ptid.pid ());
} }
static int static int

View File

@ -407,7 +407,7 @@ bsd_uthread_target::wait (ptid_t ptid, struct target_waitstatus *status,
{ {
ULONGEST magic = extract_unsigned_integer (buf, 4, byte_order); ULONGEST magic = extract_unsigned_integer (buf, 4, byte_order);
if (magic == BSD_UTHREAD_PTHREAD_MAGIC) if (magic == BSD_UTHREAD_PTHREAD_MAGIC)
ptid = ptid_t (ptid_get_pid (ptid), 0, addr); ptid = ptid_t (ptid.pid (), 0, addr);
} }
} }
@ -457,7 +457,7 @@ bsd_uthread_target::thread_alive (ptid_t ptid)
void void
bsd_uthread_target::update_thread_list () bsd_uthread_target::update_thread_list ()
{ {
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
int offset = bsd_uthread_thread_next_offset; int offset = bsd_uthread_thread_next_offset;
CORE_ADDR addr; CORE_ADDR addr;
@ -539,7 +539,7 @@ bsd_uthread_target::pid_to_str (ptid_t ptid)
static char buf[64]; static char buf[64];
xsnprintf (buf, sizeof buf, "process %d, thread 0x%lx", xsnprintf (buf, sizeof buf, "process %d, thread 0x%lx",
ptid_get_pid (ptid), ptid_get_tid (ptid)); ptid.pid (), ptid_get_tid (ptid));
return buf; return buf;
} }

View File

@ -27,14 +27,6 @@ ptid_t minus_one_ptid = ptid_t::make_minus_one ();
/* See ptid.h. */ /* See ptid.h. */
int
ptid_get_pid (const ptid_t &ptid)
{
return ptid.pid ();
}
/* See ptid.h. */
long long
ptid_get_lwp (const ptid_t &ptid) ptid_get_lwp (const ptid_t &ptid)
{ {

View File

@ -156,10 +156,6 @@ extern ptid_t minus_one_ptid;
/* The following functions are kept for backwards compatibility. The use of /* The following functions are kept for backwards compatibility. The use of
the ptid_t methods is preferred. */ the ptid_t methods is preferred. */
/* See ptid_t::pid. */
extern int ptid_get_pid (const ptid_t &ptid);
/* See ptid_t::lwp. */ /* See ptid_t::lwp. */
extern long ptid_get_lwp (const ptid_t &ptid); extern long ptid_get_lwp (const ptid_t &ptid);

View File

@ -930,7 +930,7 @@ darwin_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
inferior_debug inferior_debug
(2, _("darwin_resume: pid=%d, tid=0x%lx, step=%d, signal=%d\n"), (2, _("darwin_resume: pid=%d, tid=0x%lx, step=%d, signal=%d\n"),
ptid_get_pid (ptid), ptid_get_tid (ptid), step, signal); ptid.pid (), ptid_get_tid (ptid), step, signal);
if (signal == GDB_SIGNAL_0) if (signal == GDB_SIGNAL_0)
nsignal = 0; nsignal = 0;
@ -1199,7 +1199,7 @@ darwin_wait (ptid_t ptid, struct target_waitstatus *status)
inferior_debug inferior_debug
(2, _("darwin_wait: waiting for a message pid=%d thread=%lx\n"), (2, _("darwin_wait: waiting for a message pid=%d thread=%lx\n"),
ptid_get_pid (ptid), ptid_get_tid (ptid)); ptid.pid (), ptid_get_tid (ptid));
/* Handle fake stop events at first. */ /* Handle fake stop events at first. */
if (darwin_inf_fake_stop != NULL) if (darwin_inf_fake_stop != NULL)
@ -1924,7 +1924,7 @@ darwin_nat_target::attach (const char *args, int from_tty)
void void
darwin_nat_target::detach (inferior *inf, int from_tty) darwin_nat_target::detach (inferior *inf, int from_tty)
{ {
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
darwin_inferior *priv = get_darwin_inferior (inf); darwin_inferior *priv = get_darwin_inferior (inf);
kern_return_t kret; kern_return_t kret;
int res; int res;
@ -1967,7 +1967,7 @@ darwin_nat_target::pid_to_str (ptid_t ptid)
if (tid != 0) if (tid != 0)
{ {
snprintf (buf, sizeof (buf), _("Thread 0x%lx of process %u"), snprintf (buf, sizeof (buf), _("Thread 0x%lx of process %u"),
tid, ptid_get_pid (ptid)); tid, ptid.pid ());
return buf; return buf;
} }
@ -2272,7 +2272,7 @@ darwin_nat_target::get_ada_task_ptid (long lwp, long thread)
for (darwin_thread_t *t : priv->threads) for (darwin_thread_t *t : priv->threads)
{ {
if (t->inf_port == lwp) if (t->inf_port == lwp)
return ptid_t (ptid_get_pid (inferior_ptid), 0, t->gdb_port); return ptid_t (inferior_ptid.pid (), 0, t->gdb_port);
} }
/* Maybe the port was never extract. Do it now. */ /* Maybe the port was never extract. Do it now. */
@ -2316,7 +2316,7 @@ darwin_nat_target::get_ada_task_ptid (long lwp, long thread)
names_count * sizeof (mach_port_t)); names_count * sizeof (mach_port_t));
if (res) if (res)
return ptid_t (ptid_get_pid (inferior_ptid), 0, res); return ptid_t (inferior_ptid.pid (), 0, res);
else else
return null_ptid; return null_ptid;
} }

View File

@ -92,7 +92,7 @@ int
fbsd_nat_target::find_memory_regions (find_memory_region_ftype func, fbsd_nat_target::find_memory_regions (find_memory_region_ftype func,
void *obfd) void *obfd)
{ {
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
struct kinfo_vmentry *kve; struct kinfo_vmentry *kve;
uint64_t size; uint64_t size;
int i, nitems; int i, nitems;
@ -166,7 +166,7 @@ int
fbsd_nat_target::find_memory_regions (find_memory_region_ftype func, fbsd_nat_target::find_memory_regions (find_memory_region_ftype func,
void *obfd) void *obfd)
{ {
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
unsigned long start, end, size; unsigned long start, end, size;
char protection[4]; char protection[4];
int read, write, exec; int read, write, exec;
@ -312,7 +312,7 @@ fbsd_nat_target::info_proc (const char *args, enum info_proc_what what)
gdb_argv built_argv (args); gdb_argv built_argv (args);
if (built_argv.count () == 0) if (built_argv.count () == 0)
{ {
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
if (pid == 0) if (pid == 0)
error (_("No current process: you must name one.")); error (_("No current process: you must name one."));
} }
@ -674,7 +674,7 @@ fbsd_nat_target::xfer_partial (enum target_object object,
ULONGEST offset, ULONGEST len, ULONGEST offset, ULONGEST len,
ULONGEST *xfered_len) ULONGEST *xfered_len)
{ {
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
switch (object) switch (object)
{ {
@ -838,7 +838,7 @@ fbsd_nat_target::pid_to_str (ptid_t ptid)
if (lwp != 0) if (lwp != 0)
{ {
static char buf[64]; static char buf[64];
int pid = ptid_get_pid (ptid); int pid = ptid.pid ();
xsnprintf (buf, sizeof buf, "LWP %d of process %d", lwp, pid); xsnprintf (buf, sizeof buf, "LWP %d of process %d", lwp, pid);
return buf; return buf;
@ -856,7 +856,7 @@ fbsd_nat_target::thread_name (struct thread_info *thr)
{ {
struct ptrace_lwpinfo pl; struct ptrace_lwpinfo pl;
struct kinfo_proc kp; struct kinfo_proc kp;
int pid = ptid_get_pid (thr->ptid); int pid = thr->ptid.pid ();
long lwp = ptid_get_lwp (thr->ptid); long lwp = ptid_get_lwp (thr->ptid);
static char buf[sizeof pl.pl_tdname + 1]; static char buf[sizeof pl.pl_tdname + 1];
@ -974,7 +974,7 @@ fbsd_nat_target::update_thread_list ()
#else #else
prune_threads (); prune_threads ();
fbsd_add_threads (ptid_get_pid (inferior_ptid)); fbsd_add_threads (inferior_ptid.pid ());
#endif #endif
} }
@ -1090,9 +1090,9 @@ fbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
/* Don't PT_CONTINUE a process which has a pending vfork done event. */ /* Don't PT_CONTINUE a process which has a pending vfork done event. */
if (ptid_equal (minus_one_ptid, ptid)) if (ptid_equal (minus_one_ptid, ptid))
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
else else
pid = ptid_get_pid (ptid); pid = ptid.pid ();
if (fbsd_is_vfork_done_pending (pid)) if (fbsd_is_vfork_done_pending (pid))
return; return;
#endif #endif
@ -1100,7 +1100,7 @@ fbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
if (debug_fbsd_lwp) if (debug_fbsd_lwp)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"FLWP: fbsd_resume for ptid (%d, %ld, %ld)\n", "FLWP: fbsd_resume for ptid (%d, %ld, %ld)\n",
ptid_get_pid (ptid), ptid_get_lwp (ptid), ptid.pid (), ptid_get_lwp (ptid),
ptid_get_tid (ptid)); ptid_get_tid (ptid));
if (ptid_lwp_p (ptid)) if (ptid_lwp_p (ptid))
{ {
@ -1110,7 +1110,7 @@ fbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
ALL_NON_EXITED_THREADS (tp) ALL_NON_EXITED_THREADS (tp)
{ {
if (ptid_get_pid (tp->ptid) != ptid_get_pid (ptid)) if (tp->ptid.pid () != ptid.pid ())
continue; continue;
if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (ptid)) if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (ptid))
@ -1249,7 +1249,7 @@ fbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
pid_t pid; pid_t pid;
int status; int status;
pid = ptid_get_pid (wptid); pid = wptid.pid ();
if (ptrace (PT_LWPINFO, pid, (caddr_t) &pl, sizeof pl) == -1) if (ptrace (PT_LWPINFO, pid, (caddr_t) &pl, sizeof pl) == -1)
perror_with_name (("ptrace")); perror_with_name (("ptrace"));
@ -1361,7 +1361,7 @@ fbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
} }
/* Enable additional events on the child process. */ /* Enable additional events on the child process. */
fbsd_enable_proc_events (ptid_get_pid (child_ptid)); fbsd_enable_proc_events (child_ptid.pid ());
#ifndef PTRACE_VFORK #ifndef PTRACE_VFORK
/* For vfork, the child process will have the P_PPWAIT /* For vfork, the child process will have the P_PPWAIT
@ -1487,7 +1487,7 @@ fbsd_nat_target::follow_fork (int follow_child, int detach_fork)
if (!follow_child && detach_fork) if (!follow_child && detach_fork)
{ {
struct thread_info *tp = inferior_thread (); struct thread_info *tp = inferior_thread ();
pid_t child_pid = ptid_get_pid (tp->pending_follow.value.related_pid); pid_t child_pid = tp->pending_follow.value.related_pid.pid ();
/* Breakpoints have already been detached from the child by /* Breakpoints have already been detached from the child by
infrun.c. */ infrun.c. */
@ -1558,7 +1558,7 @@ fbsd_nat_target::remove_vfork_catchpoint (int pid)
void void
fbsd_nat_target::post_startup_inferior (ptid_t pid) fbsd_nat_target::post_startup_inferior (ptid_t pid)
{ {
fbsd_enable_proc_events (ptid_get_pid (pid)); fbsd_enable_proc_events (pid.pid ());
} }
/* Implement the "post_attach" target_ops method. */ /* Implement the "post_attach" target_ops method. */

View File

@ -406,7 +406,7 @@ static int
find_signalled_thread (struct thread_info *info, void *data) find_signalled_thread (struct thread_info *info, void *data)
{ {
if (info->suspend.stop_signal != GDB_SIGNAL_0 if (info->suspend.stop_signal != GDB_SIGNAL_0
&& ptid_get_pid (info->ptid) == ptid_get_pid (inferior_ptid)) && info->ptid.pid () == inferior_ptid.pid ())
return 1; return 1;
return 0; return 0;
@ -578,7 +578,7 @@ fbsd_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
{ {
if (thr == signalled_thr) if (thr == signalled_thr)
continue; continue;
if (ptid_get_pid (thr->ptid) != ptid_get_pid (inferior_ptid)) if (thr->ptid.pid () != inferior_ptid.pid ())
continue; continue;
fbsd_corefile_thread (thr, &thread_args); fbsd_corefile_thread (thr, &thread_args);

View File

@ -151,7 +151,7 @@ gcore_command (const char *args, int from_tty)
else else
{ {
/* Default corefile name is "core.PID". */ /* Default corefile name is "core.PID". */
corefilename.reset (xstrprintf ("core.%d", ptid_get_pid (inferior_ptid))); corefilename.reset (xstrprintf ("core.%d", inferior_ptid.pid ()));
} }
if (info_verbose) if (info_verbose)

View File

@ -1,3 +1,16 @@
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.
2018-07-03 Tom Tromey <tom@tromey.com> 2018-07-03 Tom Tromey <tom@tromey.com>
* linux-low.c: Update. * linux-low.c: Update.

View File

@ -530,7 +530,7 @@ handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
debug_printf ("HEW: Got fork event from LWP %ld, " debug_printf ("HEW: Got fork event from LWP %ld, "
"new child is %d\n", "new child is %d\n",
ptid_get_lwp (ptid_of (event_thr)), ptid_get_lwp (ptid_of (event_thr)),
ptid_get_pid (ptid)); ptid.pid ());
} }
/* Add the new process to the tables and clone the breakpoint /* Add the new process to the tables and clone the breakpoint
@ -699,7 +699,7 @@ handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
/* Get the event ptid. */ /* Get the event ptid. */
event_ptid = ptid_of (event_thr); event_ptid = ptid_of (event_thr);
event_pid = ptid_get_pid (event_ptid); event_pid = event_ptid.pid ();
/* Save the syscall list from the execing process. */ /* Save the syscall list from the execing process. */
proc = get_thread_process (event_thr); proc = get_thread_process (event_thr);
@ -1323,7 +1323,7 @@ static void
kill_wait_lwp (struct lwp_info *lwp) kill_wait_lwp (struct lwp_info *lwp)
{ {
struct thread_info *thr = get_lwp_thread (lwp); struct thread_info *thr = get_lwp_thread (lwp);
int pid = ptid_get_pid (ptid_of (thr)); int pid = ptid_of (thr).pid ();
int lwpid = ptid_get_lwp (ptid_of (thr)); int lwpid = ptid_get_lwp (ptid_of (thr));
int wstat; int wstat;
int res; int res;
@ -4546,7 +4546,7 @@ linux_set_resume_request (thread_info *thread, thread_resume *resume, size_t n)
|| ptid == thread->id || ptid == thread->id
/* Handle both 'pPID' and 'pPID.-1' as meaning 'all threads /* Handle both 'pPID' and 'pPID.-1' as meaning 'all threads
of PID'. */ of PID'. */
|| (ptid_get_pid (ptid) == pid_of (thread) || (ptid.pid () == pid_of (thread)
&& (ptid_is_pid (ptid) && (ptid_is_pid (ptid)
|| ptid_get_lwp (ptid) == -1))) || ptid_get_lwp (ptid) == -1)))
{ {

View File

@ -440,7 +440,7 @@ static void
mips_linux_prepare_to_resume (struct lwp_info *lwp) mips_linux_prepare_to_resume (struct lwp_info *lwp)
{ {
ptid_t ptid = ptid_of (get_lwp_thread (lwp)); ptid_t ptid = ptid_of (get_lwp_thread (lwp));
struct process_info *proc = find_process_pid (ptid_get_pid (ptid)); struct process_info *proc = find_process_pid (ptid.pid ());
struct arch_process_info *priv = proc->priv->arch_private; struct arch_process_info *priv = proc->priv->arch_private;
if (lwp->arch_private->watch_registers_changed) if (lwp->arch_private->watch_registers_changed)

View File

@ -83,7 +83,7 @@ lynx_ptid_t (int pid, long tid)
static int static int
lynx_ptid_get_pid (ptid_t ptid) lynx_ptid_get_pid (ptid_t ptid)
{ {
return ptid_get_pid (ptid); return ptid.pid ();
} }
/* Return the LynxOS tid of the given PTID. */ /* Return the LynxOS tid of the given PTID. */
@ -352,7 +352,7 @@ lynx_resume (struct thread_resume *resume_info, size_t n)
if (ptid_equal (ptid, minus_one_ptid)) if (ptid_equal (ptid, minus_one_ptid))
ptid = ptid_of (current_thread); ptid = ptid_of (current_thread);
regcache_invalidate_pid (ptid_get_pid (ptid)); regcache_invalidate_pid (ptid.pid ());
errno = 0; errno = 0;
lynx_ptrace (request, ptid, 1, signal, 0); lynx_ptrace (request, ptid, 1, signal, 0);

View File

@ -1482,7 +1482,7 @@ set_single_step_breakpoint (CORE_ADDR stop_at, ptid_t ptid)
{ {
struct single_step_breakpoint *bp; struct single_step_breakpoint *bp;
gdb_assert (ptid_get_pid (current_ptid) == ptid_get_pid (ptid)); gdb_assert (current_ptid.pid () == ptid.pid ());
bp = (struct single_step_breakpoint *) set_breakpoint_type_at (single_step_breakpoint, bp = (struct single_step_breakpoint *) set_breakpoint_type_at (single_step_breakpoint,
stop_at, NULL); stop_at, NULL);

View File

@ -91,7 +91,7 @@ nto_set_thread (ptid_t ptid)
{ {
int res = 0; int res = 0;
TRACE ("%s pid: %d tid: %ld\n", __func__, ptid_get_pid (ptid), TRACE ("%s pid: %d tid: %ld\n", __func__, ptid.pid (),
ptid_get_lwp (ptid)); ptid_get_lwp (ptid));
if (nto_inferior.ctl_fd != -1 if (nto_inferior.ctl_fd != -1
&& !ptid_equal (ptid, null_ptid) && !ptid_equal (ptid, null_ptid)
@ -430,9 +430,9 @@ nto_thread_alive (ptid_t ptid)
{ {
int res; int res;
TRACE ("%s pid:%d tid:%d\n", __func__, ptid_get_pid (ptid), TRACE ("%s pid:%d tid:%d\n", __func__, ptid.pid (),
ptid_get_lwp (ptid)); ptid_get_lwp (ptid));
if (SignalKill (0, ptid_get_pid (ptid), ptid_get_lwp (ptid), if (SignalKill (0, ptid.pid (), ptid_get_lwp (ptid),
0, 0, 0) == -1) 0, 0, 0) == -1)
res = 0; res = 0;
else else
@ -582,7 +582,7 @@ nto_wait (ptid_t ptid,
int waitval = 0; int waitval = 0;
TRACE (" TERMINATED\n"); TRACE (" TERMINATED\n");
waitpid (ptid_get_pid (ptid), &waitval, WNOHANG); waitpid (ptid.pid (), &waitval, WNOHANG);
if (nto_inferior.exit_signo) if (nto_inferior.exit_signo)
{ {
/* Abnormal death. */ /* Abnormal death. */

View File

@ -486,7 +486,7 @@ write_ptid (char *buf, ptid_t ptid)
if (cs.multi_process) if (cs.multi_process)
{ {
pid = ptid_get_pid (ptid); pid = ptid.pid ();
if (pid < 0) if (pid < 0)
buf += sprintf (buf, "p-%x.", -pid); buf += sprintf (buf, "p-%x.", -pid);
else else
@ -1261,14 +1261,14 @@ prepare_resume_reply (char *buf, ptid_t ptid,
case TARGET_WAITKIND_EXITED: case TARGET_WAITKIND_EXITED:
if (cs.multi_process) if (cs.multi_process)
sprintf (buf, "W%x;process:%x", sprintf (buf, "W%x;process:%x",
status->value.integer, ptid_get_pid (ptid)); status->value.integer, ptid.pid ());
else else
sprintf (buf, "W%02x", status->value.integer); sprintf (buf, "W%02x", status->value.integer);
break; break;
case TARGET_WAITKIND_SIGNALLED: case TARGET_WAITKIND_SIGNALLED:
if (cs.multi_process) if (cs.multi_process)
sprintf (buf, "X%x;process:%x", sprintf (buf, "X%x;process:%x",
status->value.sig, ptid_get_pid (ptid)); status->value.sig, ptid.pid ());
else else
sprintf (buf, "X%02x", status->value.sig); sprintf (buf, "X%02x", status->value.sig);
break; break;

View File

@ -1205,7 +1205,7 @@ handle_detach (char *own_buf)
pid = strtol (&own_buf[2], NULL, 16); pid = strtol (&own_buf[2], NULL, 16);
} }
else else
pid = ptid_get_pid (current_ptid); pid = current_ptid.pid ();
if ((tracing && disconnected_tracing) || any_persistent_commands ()) if ((tracing && disconnected_tracing) || any_persistent_commands ())
{ {
@ -2180,7 +2180,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
if (current_thread == NULL) if (current_thread == NULL)
{ {
current_thread current_thread
= find_any_thread_of_pid (ptid_get_pid (cs.general_thread)); = find_any_thread_of_pid (cs.general_thread.pid ());
/* Just in case, if we didn't find a thread, then bail out /* Just in case, if we didn't find a thread, then bail out
instead of crashing. */ instead of crashing. */
@ -2698,7 +2698,7 @@ visit_actioned_threads (thread_info *thread,
if (ptid_equal (action->thread, minus_one_ptid) if (ptid_equal (action->thread, minus_one_ptid)
|| ptid_equal (action->thread, thread->id) || ptid_equal (action->thread, thread->id)
|| ((ptid_get_pid (action->thread) || ((action->thread.pid ()
== thread->id.pid ()) == thread->id.pid ())
&& ptid_get_lwp (action->thread) == -1)) && ptid_get_lwp (action->thread) == -1))
{ {
@ -4427,7 +4427,7 @@ handle_target_event (int err, gdb_client_data client_data)
} }
else if (cs.last_status.kind != TARGET_WAITKIND_IGNORE) else if (cs.last_status.kind != TARGET_WAITKIND_IGNORE)
{ {
int pid = ptid_get_pid (cs.last_ptid); int pid = cs.last_ptid.pid ();
struct process_info *process = find_process_pid (pid); struct process_info *process = find_process_pid (pid);
int forward_event = !gdb_connected () || process->gdb_detached; int forward_event = !gdb_connected () || process->gdb_detached;

View File

@ -418,7 +418,7 @@ spu_resume (struct thread_resume *resume_info, size_t n)
static ptid_t static ptid_t
spu_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options) spu_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int options)
{ {
int pid = ptid_get_pid (ptid); int pid = ptid.pid ();
int w; int w;
int ret; int ret;

View File

@ -248,7 +248,7 @@ target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
void void
target_mourn_inferior (ptid_t ptid) target_mourn_inferior (ptid_t ptid)
{ {
(*the_target->mourn) (find_process_pid (ptid_get_pid (ptid))); (*the_target->mourn) (find_process_pid (ptid.pid ()));
} }
/* See target/target.h. */ /* See target/target.h. */
@ -320,13 +320,13 @@ target_pid_to_str (ptid_t ptid)
xsnprintf (buf, sizeof (buf), "<null thread>"); xsnprintf (buf, sizeof (buf), "<null thread>");
else if (ptid_get_tid (ptid) != 0) else if (ptid_get_tid (ptid) != 0)
xsnprintf (buf, sizeof (buf), "Thread %d.0x%lx", xsnprintf (buf, sizeof (buf), "Thread %d.0x%lx",
ptid_get_pid (ptid), ptid_get_tid (ptid)); ptid.pid (), ptid_get_tid (ptid));
else if (ptid_get_lwp (ptid) != 0) else if (ptid_get_lwp (ptid) != 0)
xsnprintf (buf, sizeof (buf), "LWP %d.%ld", xsnprintf (buf, sizeof (buf), "LWP %d.%ld",
ptid_get_pid (ptid), ptid_get_lwp (ptid)); ptid.pid (), ptid_get_lwp (ptid));
else else
xsnprintf (buf, sizeof (buf), "Process %d", xsnprintf (buf, sizeof (buf), "Process %d",
ptid_get_pid (ptid)); ptid.pid ());
return buf; return buf;
} }

View File

@ -6835,7 +6835,7 @@ static int
run_inferior_command (char *cmd, int len) run_inferior_command (char *cmd, int len)
{ {
int err = -1; int err = -1;
int pid = ptid_get_pid (current_ptid); int pid = current_ptid.pid ();
trace_debug ("run_inferior_command: running: %s", cmd); trace_debug ("run_inferior_command: running: %s", cmd);

View File

@ -2042,7 +2042,7 @@ gnu_nat_target::resume (ptid_t ptid, int step, enum gdb_signal sig)
/* Allow all threads to run, except perhaps single-stepping one. */ /* Allow all threads to run, except perhaps single-stepping one. */
{ {
inf_debug (inf, "running all threads; tid = %d", inf_debug (inf, "running all threads; tid = %d",
ptid_get_pid (inferior_ptid)); inferior_ptid.pid ());
ptid = inferior_ptid; /* What to step. */ ptid = inferior_ptid; /* What to step. */
inf_set_threads_resume_sc (inf, 0, 1); inf_set_threads_resume_sc (inf, 0, 1);
} }

View File

@ -170,7 +170,7 @@ void
hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{ {
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (regnum == -1 || hppanbsd_gregset_supplies_p (regnum)) if (regnum == -1 || hppanbsd_gregset_supplies_p (regnum))
{ {
@ -199,7 +199,7 @@ hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
void void
hppa_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum) hppa_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{ {
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (regnum == -1 || hppanbsd_gregset_supplies_p (regnum)) if (regnum == -1 || hppanbsd_gregset_supplies_p (regnum))
{ {

View File

@ -196,7 +196,7 @@ hppaobsd_collect_fpregset (struct regcache *regcache,
void void
hppa_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) hppa_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{ {
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (regnum == -1 || hppaobsd_gregset_supplies_p (regnum)) if (regnum == -1 || hppaobsd_gregset_supplies_p (regnum))
{ {

View File

@ -58,14 +58,14 @@ static i386_fbsd_nat_target the_i386_fbsd_nat_target;
void void
i386_fbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signal) i386_fbsd_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
{ {
pid_t pid = ptid_get_pid (ptid); pid_t pid = ptid.pid ();
int request = PT_STEP; int request = PT_STEP;
if (pid == -1) if (pid == -1)
/* Resume all threads. This only gets used in the non-threaded /* Resume all threads. This only gets used in the non-threaded
case, where "resume all threads" and "resume inferior_ptid" are case, where "resume all threads" and "resume inferior_ptid" are
the same. */ the same. */
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
if (!step) if (!step)
{ {
@ -148,7 +148,7 @@ i386_fbsd_nat_target::read_description ()
{ {
struct ptrace_xstate_info info; struct ptrace_xstate_info info;
if (ptrace (PT_GETXSTATE_INFO, ptid_get_pid (inferior_ptid), if (ptrace (PT_GETXSTATE_INFO, inferior_ptid.pid (),
(PTRACE_TYPE_ARG3) &info, sizeof (info)) == 0) (PTRACE_TYPE_ARG3) &info, sizeof (info)) == 0)
{ {
x86bsd_xsave_len = info.xsave_len; x86bsd_xsave_len = info.xsave_len;

View File

@ -555,7 +555,7 @@ store_debug_register (ptid_t ptid, int idx, long val)
tid = ptid_get_lwp (ptid); tid = ptid_get_lwp (ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (ptid); tid = ptid.pid ();
(void) ptrace (PT_WRITE_U, tid, (PTRACE_TYPE_ARG3) (PT_DBR + 8 * idx), val); (void) ptrace (PT_WRITE_U, tid, (PTRACE_TYPE_ARG3) (PT_DBR + 8 * idx), val);
} }

View File

@ -66,7 +66,7 @@ inf_ptrace_target::follow_fork (int follow_child, int detach_fork)
if (!follow_child) if (!follow_child)
{ {
struct thread_info *tp = inferior_thread (); struct thread_info *tp = inferior_thread ();
pid_t child_pid = ptid_get_pid (tp->pending_follow.value.related_pid); pid_t child_pid = tp->pending_follow.value.related_pid.pid ();
/* Breakpoints have already been detached from the child by /* Breakpoints have already been detached from the child by
infrun.c. */ infrun.c. */
@ -156,7 +156,7 @@ inf_ptrace_target::post_startup_inferior (ptid_t pid)
/* Set the initial event mask. */ /* Set the initial event mask. */
memset (&pe, 0, sizeof pe); memset (&pe, 0, sizeof pe);
pe.pe_set_event |= PTRACE_FORK; pe.pe_set_event |= PTRACE_FORK;
if (ptrace (PT_SET_EVENT_MASK, ptid_get_pid (pid), if (ptrace (PT_SET_EVENT_MASK, pid.pid (),
(PTRACE_TYPE_ARG3)&pe, sizeof pe) == -1) (PTRACE_TYPE_ARG3)&pe, sizeof pe) == -1)
perror_with_name (("ptrace")); perror_with_name (("ptrace"));
} }
@ -174,7 +174,7 @@ inf_ptrace_target::mourn_inferior ()
Do not check whether this succeeds though, since we may be Do not check whether this succeeds though, since we may be
dealing with a process that we attached to. Such a process will dealing with a process that we attached to. Such a process will
only report its exit status to its original parent. */ only report its exit status to its original parent. */
waitpid (ptid_get_pid (inferior_ptid), &status, 0); waitpid (inferior_ptid.pid (), &status, 0);
inf_child_target::mourn_inferior (); inf_child_target::mourn_inferior ();
} }
@ -267,7 +267,7 @@ inf_ptrace_target::post_attach (int pid)
void void
inf_ptrace_target::detach (inferior *inf, int from_tty) inf_ptrace_target::detach (inferior *inf, int from_tty)
{ {
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
target_announce_detach (from_tty); target_announce_detach (from_tty);
@ -303,7 +303,7 @@ inf_ptrace_target::detach_success (inferior *inf)
void void
inf_ptrace_target::kill () inf_ptrace_target::kill ()
{ {
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
int status; int status;
if (pid == 0) if (pid == 0)
@ -327,7 +327,7 @@ get_ptrace_pid (ptid_t ptid)
dealing with a non-threaded program/target. */ dealing with a non-threaded program/target. */
pid = ptid_get_lwp (ptid); pid = ptid_get_lwp (ptid);
if (pid == 0) if (pid == 0)
pid = ptid_get_pid (ptid); pid = ptid.pid ();
return pid; return pid;
} }
@ -344,7 +344,7 @@ inf_ptrace_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
if (ptid_equal (minus_one_ptid, ptid)) if (ptid_equal (minus_one_ptid, ptid))
/* Resume all threads. Traditionally ptrace() only supports /* Resume all threads. Traditionally ptrace() only supports
single-threaded processes, so simply resume the inferior. */ single-threaded processes, so simply resume the inferior. */
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
else else
pid = get_ptrace_pid (ptid); pid = get_ptrace_pid (ptid);
@ -389,7 +389,7 @@ inf_ptrace_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
do do
{ {
pid = waitpid (ptid_get_pid (ptid), &status, 0); pid = waitpid (ptid.pid (), &status, 0);
save_errno = errno; save_errno = errno;
} }
while (pid == -1 && errno == EINTR); while (pid == -1 && errno == EINTR);
@ -409,7 +409,7 @@ inf_ptrace_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
} }
/* Ignore terminated detached child processes. */ /* Ignore terminated detached child processes. */
if (!WIFSTOPPED (status) && pid != ptid_get_pid (inferior_ptid)) if (!WIFSTOPPED (status) && pid != inferior_ptid.pid ())
pid = -1; pid = -1;
} }
while (pid == -1); while (pid == -1);
@ -441,7 +441,7 @@ inf_ptrace_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
gdb_assert (pe.pe_report_event == PTRACE_FORK); gdb_assert (pe.pe_report_event == PTRACE_FORK);
gdb_assert (pe.pe_other_pid == pid); gdb_assert (pe.pe_other_pid == pid);
if (fpid == ptid_get_pid (inferior_ptid)) if (fpid == inferior_ptid.pid ())
{ {
ourstatus->value.related_pid = ptid_t (pe.pe_other_pid); ourstatus->value.related_pid = ptid_t (pe.pe_other_pid);
return ptid_t (fpid); return ptid_t (fpid);
@ -614,7 +614,7 @@ bool
inf_ptrace_target::thread_alive (ptid_t ptid) inf_ptrace_target::thread_alive (ptid_t ptid)
{ {
/* ??? Is kill the right way to do this? */ /* ??? Is kill the right way to do this? */
return (::kill (ptid_get_pid (ptid), 0) != -1); return (::kill (ptid.pid (), 0) != -1);
} }
/* Print status information about what we're accessing. */ /* Print status information about what we're accessing. */

View File

@ -2638,7 +2638,7 @@ proceed_after_attach_callback (struct thread_info *thread,
{ {
int pid = * (int *) arg; int pid = * (int *) arg;
if (ptid_get_pid (thread->ptid) == pid if (thread->ptid.pid () == pid
&& thread->state != THREAD_EXITED && thread->state != THREAD_EXITED
&& !thread->executing && !thread->executing
&& !thread->stop_requested && !thread->stop_requested
@ -2677,7 +2677,7 @@ setup_inferior (int from_tty)
/* If no exec file is yet known, try to determine it from the /* If no exec file is yet known, try to determine it from the
process itself. */ process itself. */
if (get_exec_file (0) == NULL) if (get_exec_file (0) == NULL)
exec_file_locate_attach (ptid_get_pid (inferior_ptid), 1, from_tty); exec_file_locate_attach (inferior_ptid.pid (), 1, from_tty);
else else
{ {
reopen_exec_file (); reopen_exec_file ();
@ -2685,7 +2685,7 @@ setup_inferior (int from_tty)
} }
/* Take any necessary post-attaching actions for this platform. */ /* Take any necessary post-attaching actions for this platform. */
target_post_attach (ptid_get_pid (inferior_ptid)); target_post_attach (inferior_ptid.pid ());
post_create_inferior (current_top_target (), from_tty); post_create_inferior (current_top_target (), from_tty);
} }
@ -2766,7 +2766,7 @@ attach_post_wait (const char *args, int from_tty, enum attach_post_wait_mode mod
still exists. */ still exists. */
ALL_NON_EXITED_THREADS (thread) ALL_NON_EXITED_THREADS (thread)
{ {
if (ptid_get_pid (thread->ptid) == pid) if (thread->ptid.pid () == pid)
{ {
if (thread->inf->num < lowest->inf->num if (thread->inf->num < lowest->inf->num
|| thread->per_inf_num < lowest->per_inf_num) || thread->per_inf_num < lowest->per_inf_num)
@ -2897,7 +2897,7 @@ attach_command (const char *args, int from_tty)
else else
/* The user requested an `attach', so stop all threads of this /* The user requested an `attach', so stop all threads of this
inferior. */ inferior. */
target_stop (ptid_t (ptid_get_pid (inferior_ptid))); target_stop (ptid_t (inferior_ptid.pid ()));
} }
mode = async_exec ? ATTACH_POST_WAIT_RESUME : ATTACH_POST_WAIT_STOP; mode = async_exec ? ATTACH_POST_WAIT_RESUME : ATTACH_POST_WAIT_STOP;

View File

@ -141,7 +141,7 @@ delete_thread_of_inferior (struct thread_info *tp, void *data)
struct delete_thread_of_inferior_arg *arg struct delete_thread_of_inferior_arg *arg
= (struct delete_thread_of_inferior_arg *) data; = (struct delete_thread_of_inferior_arg *) data;
if (ptid_get_pid (tp->ptid) == arg->pid) if (tp->ptid.pid () == arg->pid)
{ {
if (arg->silent) if (arg->silent)
delete_thread_silent (tp); delete_thread_silent (tp);
@ -322,7 +322,7 @@ find_inferior_pid (int pid)
struct inferior * struct inferior *
find_inferior_ptid (ptid_t ptid) find_inferior_ptid (ptid_t ptid)
{ {
return find_inferior_pid (ptid_get_pid (ptid)); return find_inferior_pid (ptid.pid ());
} }
/* See inferior.h. */ /* See inferior.h. */
@ -388,7 +388,7 @@ number_of_live_inferiors (void)
struct thread_info *tp; struct thread_info *tp;
ALL_NON_EXITED_THREADS (tp) ALL_NON_EXITED_THREADS (tp)
if (tp && ptid_get_pid (tp->ptid) == inf->pid) if (tp && tp->ptid.pid () == inf->pid)
if (target_has_execution_1 (tp->ptid)) if (target_has_execution_1 (tp->ptid))
{ {
/* Found a live thread in this inferior, go to the next /* Found a live thread in this inferior, go to the next

View File

@ -84,7 +84,7 @@ extern void set_inferior_io_terminal (const char *terminal_name);
extern const char *get_inferior_io_terminal (void); extern const char *get_inferior_io_terminal (void);
/* Collected pid, tid, etc. of the debugged inferior. When there's /* Collected pid, tid, etc. of the debugged inferior. When there's
no inferior, ptid_get_pid (inferior_ptid) will be 0. */ no inferior, inferior_ptid.pid () will be 0. */
extern ptid_t inferior_ptid; extern ptid_t inferior_ptid;

View File

@ -908,7 +908,7 @@ static void
pass_signal (int signo) pass_signal (int signo)
{ {
#ifndef _WIN32 #ifndef _WIN32
kill (ptid_get_pid (inferior_ptid), SIGINT); kill (inferior_ptid.pid (), SIGINT);
#endif #endif
} }

View File

@ -462,7 +462,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
if (print_inferior_events) if (print_inferior_events)
{ {
/* Ensure that we have a process ptid. */ /* Ensure that we have a process ptid. */
ptid_t process_ptid = ptid_t (ptid_get_pid (child_ptid)); ptid_t process_ptid = ptid_t (child_ptid.pid ());
target_terminal::ours_for_output (); target_terminal::ours_for_output ();
fprintf_filtered (gdb_stdlog, fprintf_filtered (gdb_stdlog,
@ -476,7 +476,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
struct inferior *parent_inf, *child_inf; struct inferior *parent_inf, *child_inf;
/* Add process to GDB's tables. */ /* Add process to GDB's tables. */
child_inf = add_inferior (ptid_get_pid (child_ptid)); child_inf = add_inferior (child_ptid.pid ());
parent_inf = current_inferior (); parent_inf = current_inferior ();
child_inf->attach_flag = parent_inf->attach_flag; child_inf->attach_flag = parent_inf->attach_flag;
@ -563,7 +563,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
/* Add the new inferior first, so that the target_detach below /* Add the new inferior first, so that the target_detach below
doesn't unpush the target. */ doesn't unpush the target. */
child_inf = add_inferior (ptid_get_pid (child_ptid)); child_inf = add_inferior (child_ptid.pid ());
parent_inf = current_inferior (); parent_inf = current_inferior ();
child_inf->attach_flag = parent_inf->attach_flag; child_inf->attach_flag = parent_inf->attach_flag;
@ -598,7 +598,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \
if (print_inferior_events) if (print_inferior_events)
{ {
/* Ensure that we have a process ptid. */ /* Ensure that we have a process ptid. */
ptid_t process_ptid = ptid_t (ptid_get_pid (parent_ptid)); ptid_t process_ptid = ptid_t (parent_ptid.pid ());
target_terminal::ours_for_output (); target_terminal::ours_for_output ();
fprintf_filtered (gdb_stdlog, fprintf_filtered (gdb_stdlog,
@ -1082,7 +1082,7 @@ follow_exec (ptid_t ptid, char *exec_file_target)
{ {
struct thread_info *th, *tmp; struct thread_info *th, *tmp;
struct inferior *inf = current_inferior (); struct inferior *inf = current_inferior ();
int pid = ptid_get_pid (ptid); int pid = ptid.pid ();
ptid_t process_ptid; ptid_t process_ptid;
/* This is an exec event that we actually wish to pay attention to. /* This is an exec event that we actually wish to pay attention to.
@ -1128,7 +1128,7 @@ follow_exec (ptid_t ptid, char *exec_file_target)
stop provides a nicer sequence of events for user and MI stop provides a nicer sequence of events for user and MI
notifications. */ notifications. */
ALL_THREADS_SAFE (th, tmp) ALL_THREADS_SAFE (th, tmp)
if (ptid_get_pid (th->ptid) == pid && !ptid_equal (th->ptid, ptid)) if (th->ptid.pid () == pid && !ptid_equal (th->ptid, ptid))
delete_thread (th); delete_thread (th);
/* We also need to clear any left over stale state for the /* We also need to clear any left over stale state for the
@ -2268,7 +2268,7 @@ user_visible_resume_ptid (int step)
{ {
/* Resume all threads of the current process (and none of other /* Resume all threads of the current process (and none of other
processes). */ processes). */
resume_ptid = ptid_t (ptid_get_pid (inferior_ptid)); resume_ptid = ptid_t (inferior_ptid.pid ());
} }
else else
{ {
@ -3422,14 +3422,14 @@ print_target_wait_results (ptid_t waiton_ptid, ptid_t result_ptid,
is set. */ is set. */
stb.printf ("infrun: target_wait (%d.%ld.%ld", stb.printf ("infrun: target_wait (%d.%ld.%ld",
ptid_get_pid (waiton_ptid), waiton_ptid.pid (),
ptid_get_lwp (waiton_ptid), ptid_get_lwp (waiton_ptid),
ptid_get_tid (waiton_ptid)); ptid_get_tid (waiton_ptid));
if (ptid_get_pid (waiton_ptid) != -1) if (waiton_ptid.pid () != -1)
stb.printf (" [%s]", target_pid_to_str (waiton_ptid)); stb.printf (" [%s]", target_pid_to_str (waiton_ptid));
stb.printf (", status) =\n"); stb.printf (", status) =\n");
stb.printf ("infrun: %d.%ld.%ld [%s],\n", stb.printf ("infrun: %d.%ld.%ld [%s],\n",
ptid_get_pid (result_ptid), result_ptid.pid (),
ptid_get_lwp (result_ptid), ptid_get_lwp (result_ptid),
ptid_get_tid (result_ptid), ptid_get_tid (result_ptid),
target_pid_to_str (result_ptid)); target_pid_to_str (result_ptid));
@ -4376,7 +4376,7 @@ save_waitstatus (struct thread_info *tp, struct target_waitstatus *ws)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"infrun: saving status %s for %d.%ld.%ld\n", "infrun: saving status %s for %d.%ld.%ld\n",
statstr.c_str (), statstr.c_str (),
ptid_get_pid (tp->ptid), tp->ptid.pid (),
ptid_get_lwp (tp->ptid), ptid_get_lwp (tp->ptid),
ptid_get_tid (tp->ptid)); ptid_get_tid (tp->ptid));
} }
@ -4613,7 +4613,7 @@ stop_all_threads (void)
"infrun: target_wait %s, saving " "infrun: target_wait %s, saving "
"status for %d.%ld.%ld\n", "status for %d.%ld.%ld\n",
statstr.c_str (), statstr.c_str (),
ptid_get_pid (t->ptid), t->ptid.pid (),
ptid_get_lwp (t->ptid), ptid_get_lwp (t->ptid),
ptid_get_tid (t->ptid)); ptid_get_tid (t->ptid));
} }
@ -4904,7 +4904,7 @@ handle_inferior_event_1 (struct execution_control_state *ecs)
process as not-executing so that finish_thread_state marks process as not-executing so that finish_thread_state marks
them stopped (in the user's perspective) if/when we present them stopped (in the user's perspective) if/when we present
the stop to the user. */ the stop to the user. */
mark_ptid = ptid_t (ptid_get_pid (ecs->ptid)); mark_ptid = ptid_t (ecs->ptid.pid ());
} }
else else
mark_ptid = ecs->ptid; mark_ptid = ecs->ptid;
@ -7106,7 +7106,7 @@ switch_back_to_stepped_thread (struct execution_control_state *ecs)
/* Ignore threads of processes the caller is not /* Ignore threads of processes the caller is not
resuming. */ resuming. */
if (!sched_multi if (!sched_multi
&& ptid_get_pid (tp->ptid) != ptid_get_pid (ecs->ptid)) && tp->ptid.pid () != ecs->ptid.pid ())
continue; continue;
/* When stepping over a breakpoint, we lock all threads /* When stepping over a breakpoint, we lock all threads

View File

@ -83,14 +83,14 @@ add_fork (pid_t pid)
{ {
struct fork_info *fp; struct fork_info *fp;
if (fork_list == NULL && pid != ptid_get_pid (inferior_ptid)) if (fork_list == NULL && pid != inferior_ptid.pid ())
{ {
/* Special case -- if this is the first fork in the list /* Special case -- if this is the first fork in the list
(the list is hitherto empty), and if this new fork is (the list is hitherto empty), and if this new fork is
NOT the current inferior_ptid, then add inferior_ptid NOT the current inferior_ptid, then add inferior_ptid
first, as a special zeroeth fork id. */ first, as a special zeroeth fork id. */
highest_fork_num = -1; highest_fork_num = -1;
add_fork (ptid_get_pid (inferior_ptid)); /* safe recursion */ add_fork (inferior_ptid.pid ()); /* safe recursion */
} }
fp = XCNEW (struct fork_info); fp = XCNEW (struct fork_info);
@ -141,7 +141,7 @@ delete_fork (ptid_t ptid)
fpprev = NULL; fpprev = NULL;
linux_target->low_forget_process (ptid_get_pid (ptid)); linux_target->low_forget_process (ptid.pid ());
for (fp = fork_list; fp; fpprev = fp, fp = fp->next) for (fp = fork_list; fp; fpprev = fp, fp = fp->next)
if (ptid_equal (fp->ptid, ptid)) if (ptid_equal (fp->ptid, ptid))
@ -203,7 +203,7 @@ find_fork_pid (pid_t pid)
struct fork_info *fp; struct fork_info *fp;
for (fp = fork_list; fp; fp = fp->next) for (fp = fork_list; fp; fp = fp->next)
if (pid == ptid_get_pid (fp->ptid)) if (pid == fp->ptid.pid ())
return fp; return fp;
return NULL; return NULL;
@ -305,7 +305,7 @@ fork_save_infrun_state (struct fork_info *fp, int clobber_regs)
/* Now save the 'state' (file position) of all open file descriptors. /* Now save the 'state' (file position) of all open file descriptors.
Unfortunately fork does not take care of that for us... */ Unfortunately fork does not take care of that for us... */
snprintf (path, PATH_MAX, "/proc/%ld/fd", snprintf (path, PATH_MAX, "/proc/%ld/fd",
(long) ptid_get_pid (fp->ptid)); (long) fp->ptid.pid ());
if ((d = opendir (path)) != NULL) if ((d = opendir (path)) != NULL)
{ {
long tmp; long tmp;
@ -355,7 +355,7 @@ linux_fork_killall (void)
for (fp = fork_list; fp; fp = fp->next) for (fp = fork_list; fp; fp = fp->next)
{ {
pid = ptid_get_pid (fp->ptid); pid = fp->ptid.pid ();
do { do {
/* Use SIGKILL instead of PTRACE_KILL because the former works even /* Use SIGKILL instead of PTRACE_KILL because the former works even
if the thread is running, while the later doesn't. */ if the thread is running, while the later doesn't. */
@ -383,7 +383,7 @@ linux_fork_mourn_inferior (void)
Do not check whether this succeeds though, since we may be Do not check whether this succeeds though, since we may be
dealing with a process that we attached to. Such a process will dealing with a process that we attached to. Such a process will
only report its exit status to its original parent. */ only report its exit status to its original parent. */
waitpid (ptid_get_pid (inferior_ptid), &status, 0); waitpid (inferior_ptid.pid (), &status, 0);
/* OK, presumably inferior_ptid is the one who has exited. /* OK, presumably inferior_ptid is the one who has exited.
We need to delete that one from the fork_list, and switch We need to delete that one from the fork_list, and switch
@ -416,7 +416,7 @@ linux_fork_detach (int from_tty)
delete it from the fork_list, and switch to the next available delete it from the fork_list, and switch to the next available
fork. */ fork. */
if (ptrace (PTRACE_DETACH, ptid_get_pid (inferior_ptid), 0, 0)) if (ptrace (PTRACE_DETACH, inferior_ptid.pid (), 0, 0))
error (_("Unable to detach %s"), target_pid_to_str (inferior_ptid)); error (_("Unable to detach %s"), target_pid_to_str (inferior_ptid));
delete_fork (inferior_ptid); delete_fork (inferior_ptid);
@ -522,7 +522,7 @@ delete_checkpoint_command (const char *args, int from_tty)
error (_("\ error (_("\
Please switch to another checkpoint before deleting the current one")); Please switch to another checkpoint before deleting the current one"));
if (ptrace (PTRACE_KILL, ptid_get_pid (ptid), 0, 0)) if (ptrace (PTRACE_KILL, ptid.pid (), 0, 0))
error (_("Unable to kill pid %s"), target_pid_to_str (ptid)); error (_("Unable to kill pid %s"), target_pid_to_str (ptid));
fi = find_fork_ptid (ptid); fi = find_fork_ptid (ptid);
@ -542,7 +542,7 @@ Please switch to another checkpoint before deleting the current one"));
if ((parent == NULL && find_fork_ptid (pptid)) if ((parent == NULL && find_fork_ptid (pptid))
|| (parent != NULL && parent->state == THREAD_STOPPED)) || (parent != NULL && parent->state == THREAD_STOPPED))
{ {
if (inferior_call_waitpid (pptid, ptid_get_pid (ptid))) if (inferior_call_waitpid (pptid, ptid.pid ()))
warning (_("Unable to wait pid %s"), target_pid_to_str (ptid)); warning (_("Unable to wait pid %s"), target_pid_to_str (ptid));
} }
} }
@ -563,7 +563,7 @@ detach_checkpoint_command (const char *args, int from_tty)
error (_("\ error (_("\
Please switch to another checkpoint before detaching the current one")); Please switch to another checkpoint before detaching the current one"));
if (ptrace (PTRACE_DETACH, ptid_get_pid (ptid), 0, 0)) if (ptrace (PTRACE_DETACH, ptid.pid (), 0, 0))
error (_("Unable to detach %s"), target_pid_to_str (ptid)); error (_("Unable to detach %s"), target_pid_to_str (ptid));
if (from_tty) if (from_tty)
@ -649,7 +649,7 @@ inf_has_multiple_thread_cb (struct thread_info *tp, void *data)
{ {
int *count_p = (int *) data; int *count_p = (int *) data;
if (current_inferior ()->pid == ptid_get_pid (tp->ptid)) if (current_inferior ()->pid == tp->ptid.pid ())
(*count_p)++; (*count_p)++;
/* Stop the iteration if multiple threads have been detected. */ /* Stop the iteration if multiple threads have been detected. */
@ -702,7 +702,7 @@ checkpoint_command (const char *args, int from_tty)
/* Tell linux-nat.c that we're checkpointing this inferior. */ /* Tell linux-nat.c that we're checkpointing this inferior. */
{ {
scoped_restore save_pid scoped_restore save_pid
= make_scoped_restore (&checkpointing_pid, ptid_get_pid (inferior_ptid)); = make_scoped_restore (&checkpointing_pid, inferior_ptid.pid ());
ret = call_function_by_hand (fork_fn, NULL, 0, &ret); ret = call_function_by_hand (fork_fn, NULL, 0, &ret);
} }
@ -725,7 +725,7 @@ checkpoint_command (const char *args, int from_tty)
{ {
parent_pid = ptid_get_lwp (last_target_ptid); parent_pid = ptid_get_lwp (last_target_ptid);
if (parent_pid == 0) if (parent_pid == 0)
parent_pid = ptid_get_pid (last_target_ptid); parent_pid = last_target_ptid.pid ();
printf_filtered (_(" gdb says parent = %ld.\n"), printf_filtered (_(" gdb says parent = %ld.\n"),
(long) parent_pid); (long) parent_pid);
} }

View File

@ -410,7 +410,7 @@ linux_nat_target::post_attach (int pid)
void void
linux_nat_target::post_startup_inferior (ptid_t ptid) linux_nat_target::post_startup_inferior (ptid_t ptid)
{ {
linux_init_ptrace (ptid_get_pid (ptid), 0); linux_init_ptrace (ptid.pid (), 0);
} }
/* Return the number of known LWPs in the tgid given by PID. */ /* Return the number of known LWPs in the tgid given by PID. */
@ -422,7 +422,7 @@ num_lwps (int pid)
struct lwp_info *lp; struct lwp_info *lp;
for (lp = lwp_list; lp; lp = lp->next) for (lp = lwp_list; lp; lp = lp->next)
if (ptid_get_pid (lp->ptid) == pid) if (lp->ptid.pid () == pid)
count++; count++;
return count; return count;
@ -821,7 +821,7 @@ lwp_lwpid_htab_remove_pid (void **slot, void *info)
struct lwp_info *lp = (struct lwp_info *) *slot; struct lwp_info *lp = (struct lwp_info *) *slot;
int pid = *(int *) info; int pid = *(int *) info;
if (ptid_get_pid (lp->ptid) == pid) if (lp->ptid.pid () == pid)
{ {
htab_clear_slot (lwp_lwpid_htab, slot); htab_clear_slot (lwp_lwpid_htab, slot);
lwp_list_remove (lp); lwp_list_remove (lp);
@ -938,7 +938,7 @@ find_lwp_pid (ptid_t ptid)
if (ptid_lwp_p (ptid)) if (ptid_lwp_p (ptid))
lwp = ptid_get_lwp (ptid); lwp = ptid_get_lwp (ptid);
else else
lwp = ptid_get_pid (ptid); lwp = ptid.pid ();
dummy.ptid = ptid_t (0, lwp, 0); dummy.ptid = ptid_t (0, lwp, 0);
lp = (struct lwp_info *) htab_find (lwp_lwpid_htab, &dummy); lp = (struct lwp_info *) htab_find (lwp_lwpid_htab, &dummy);
@ -978,7 +978,7 @@ linux_nat_switch_fork (ptid_t new_ptid)
{ {
struct lwp_info *lp; struct lwp_info *lp;
purge_lwp_list (ptid_get_pid (inferior_ptid)); purge_lwp_list (inferior_ptid.pid ());
lp = add_lwp (new_ptid); lp = add_lwp (new_ptid);
lp->stopped = 1; lp->stopped = 1;
@ -1196,8 +1196,8 @@ linux_nat_target::attach (const char *args, int from_tty)
/* The ptrace base target adds the main thread with (pid,0,0) /* The ptrace base target adds the main thread with (pid,0,0)
format. Decorate it with lwp info. */ format. Decorate it with lwp info. */
ptid = ptid_t (ptid_get_pid (inferior_ptid), ptid = ptid_t (inferior_ptid.pid (),
ptid_get_pid (inferior_ptid), inferior_ptid.pid (),
0); 0);
thread_change_ptid (inferior_ptid, ptid); thread_change_ptid (inferior_ptid, ptid);
@ -1245,7 +1245,7 @@ linux_nat_target::attach (const char *args, int from_tty)
if (debug_linux_nat) if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
"LNA: waitpid %ld, saving status %s\n", "LNA: waitpid %ld, saving status %s\n",
(long) ptid_get_pid (lp->ptid), status_to_str (status)); (long) lp->ptid.pid (), status_to_str (status));
lp->status = status; lp->status = status;
@ -1256,7 +1256,7 @@ linux_nat_target::attach (const char *args, int from_tty)
of threads/LWPs, and those structures may well be corrupted. of threads/LWPs, and those structures may well be corrupted.
Note that once thread_db is loaded, we'll still use it to list Note that once thread_db is loaded, we'll still use it to list
threads and associate pthread info with each LWP. */ threads and associate pthread info with each LWP. */
linux_proc_attach_tgid_threads (ptid_get_pid (lp->ptid), linux_proc_attach_tgid_threads (lp->ptid.pid (),
attach_proc_task_lwp_callback); attach_proc_task_lwp_callback);
if (target_can_async_p ()) if (target_can_async_p ())
@ -1450,7 +1450,7 @@ detach_callback (struct lwp_info *lp, void *data)
/* We don't actually detach from the thread group leader just yet. /* We don't actually detach from the thread group leader just yet.
If the thread group exits, we must reap the zombie clone lwps If the thread group exits, we must reap the zombie clone lwps
before we're able to reap the leader. */ before we're able to reap the leader. */
if (ptid_get_lwp (lp->ptid) != ptid_get_pid (lp->ptid)) if (ptid_get_lwp (lp->ptid) != lp->ptid.pid ())
detach_one_lwp (lp, NULL); detach_one_lwp (lp, NULL);
return 0; return 0;
} }
@ -1969,7 +1969,7 @@ linux_handle_extended_wait (struct lwp_info *lp, int status)
} }
if (event == PTRACE_EVENT_FORK if (event == PTRACE_EVENT_FORK
&& linux_fork_checkpointing_p (ptid_get_pid (lp->ptid))) && linux_fork_checkpointing_p (lp->ptid.pid ()))
{ {
/* Handle checkpointing by linux-fork.c here as a special /* Handle checkpointing by linux-fork.c here as a special
case. We don't want the follow-fork-mode or 'catch fork' case. We don't want the follow-fork-mode or 'catch fork'
@ -2008,7 +2008,7 @@ linux_handle_extended_wait (struct lwp_info *lp, int status)
"from LWP %d, new child is LWP %ld\n", "from LWP %d, new child is LWP %ld\n",
pid, new_pid); pid, new_pid);
new_lp = add_lwp (ptid_t (ptid_get_pid (lp->ptid), new_pid, 0)); new_lp = add_lwp (ptid_t (lp->ptid.pid (), new_pid, 0));
new_lp->stopped = 1; new_lp->stopped = 1;
new_lp->resumed = 1; new_lp->resumed = 1;
@ -2181,7 +2181,7 @@ wait_lwp (struct lwp_info *lp)
Therefore always use WNOHANG with sigsuspend - it is equivalent to Therefore always use WNOHANG with sigsuspend - it is equivalent to
waiting waitpid but linux_proc_pid_is_zombie is safe this way. */ waiting waitpid but linux_proc_pid_is_zombie is safe this way. */
if (ptid_get_pid (lp->ptid) == ptid_get_lwp (lp->ptid) if (lp->ptid.pid () == ptid_get_lwp (lp->ptid)
&& linux_proc_pid_is_zombie (ptid_get_lwp (lp->ptid))) && linux_proc_pid_is_zombie (ptid_get_lwp (lp->ptid)))
{ {
thread_dead = 1; thread_dead = 1;
@ -2219,11 +2219,11 @@ wait_lwp (struct lwp_info *lp)
if (WIFEXITED (status) || WIFSIGNALED (status)) if (WIFEXITED (status) || WIFSIGNALED (status))
{ {
if (report_thread_events if (report_thread_events
|| ptid_get_pid (lp->ptid) == ptid_get_lwp (lp->ptid)) || lp->ptid.pid () == ptid_get_lwp (lp->ptid))
{ {
if (debug_linux_nat) if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog, "WL: LWP %d exited.\n", fprintf_unfiltered (gdb_stdlog, "WL: LWP %d exited.\n",
ptid_get_pid (lp->ptid)); lp->ptid.pid ());
/* If this is the leader exiting, it means the whole /* If this is the leader exiting, it means the whole
process is gone. Store the status to report to the process is gone. Store the status to report to the
@ -2251,7 +2251,7 @@ wait_lwp (struct lwp_info *lp)
if (lp->must_set_ptrace_flags) if (lp->must_set_ptrace_flags)
{ {
struct inferior *inf = find_inferior_pid (ptid_get_pid (lp->ptid)); struct inferior *inf = find_inferior_pid (lp->ptid.pid ());
int options = linux_nat_ptrace_options (inf->attach_flag); int options = linux_nat_ptrace_options (inf->attach_flag);
linux_enable_event_reporting (ptid_get_lwp (lp->ptid), options); linux_enable_event_reporting (ptid_get_lwp (lp->ptid), options);
@ -2973,7 +2973,7 @@ linux_nat_filter_event (int lwpid, int status)
if (WIFSTOPPED (status) && lp->must_set_ptrace_flags) if (WIFSTOPPED (status) && lp->must_set_ptrace_flags)
{ {
struct inferior *inf = find_inferior_pid (ptid_get_pid (lp->ptid)); struct inferior *inf = find_inferior_pid (lp->ptid.pid ());
int options = linux_nat_ptrace_options (inf->attach_flag); int options = linux_nat_ptrace_options (inf->attach_flag);
linux_enable_event_reporting (ptid_get_lwp (lp->ptid), options); linux_enable_event_reporting (ptid_get_lwp (lp->ptid), options);
@ -3014,7 +3014,7 @@ linux_nat_filter_event (int lwpid, int status)
if (WIFEXITED (status) || WIFSIGNALED (status)) if (WIFEXITED (status) || WIFSIGNALED (status))
{ {
if (!report_thread_events if (!report_thread_events
&& num_lwps (ptid_get_pid (lp->ptid)) > 1) && num_lwps (lp->ptid.pid ()) > 1)
{ {
if (debug_linux_nat) if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog, fprintf_unfiltered (gdb_stdlog,
@ -3125,7 +3125,7 @@ linux_nat_filter_event (int lwpid, int status)
will receive it - unless they're using CLONE_THREAD to will receive it - unless they're using CLONE_THREAD to
share signals. Since we only want to report it once, we share signals. Since we only want to report it once, we
mark it as ignored for all LWPs except this one. */ mark it as ignored for all LWPs except this one. */
iterate_over_lwps (ptid_t (ptid_get_pid (lp->ptid)), iterate_over_lwps (ptid_t (lp->ptid.pid ()),
set_ignore_sigint, NULL); set_ignore_sigint, NULL);
lp->ignore_sigint = 0; lp->ignore_sigint = 0;
} }
@ -3227,7 +3227,7 @@ filter_exit_event (struct lwp_info *event_child,
{ {
ptid_t ptid = event_child->ptid; ptid_t ptid = event_child->ptid;
if (num_lwps (ptid_get_pid (ptid)) > 1) if (num_lwps (ptid.pid ()) > 1)
{ {
if (report_thread_events) if (report_thread_events)
ourstatus->kind = TARGET_WAITKIND_THREAD_EXITED; ourstatus->kind = TARGET_WAITKIND_THREAD_EXITED;
@ -3259,8 +3259,8 @@ linux_nat_wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
{ {
/* Upgrade the main thread's ptid. */ /* Upgrade the main thread's ptid. */
thread_change_ptid (inferior_ptid, thread_change_ptid (inferior_ptid,
ptid_t (ptid_get_pid (inferior_ptid), ptid_t (inferior_ptid.pid (),
ptid_get_pid (inferior_ptid), 0)); inferior_ptid.pid (), 0));
lp = add_initial_lwp (inferior_ptid); lp = add_initial_lwp (inferior_ptid);
lp->resumed = 1; lp->resumed = 1;
@ -3688,7 +3688,7 @@ kill_unfollowed_fork_children (struct inferior *inf)
|| ws->kind == TARGET_WAITKIND_VFORKED) || ws->kind == TARGET_WAITKIND_VFORKED)
{ {
ptid_t child_ptid = ws->value.related_pid; ptid_t child_ptid = ws->value.related_pid;
int child_pid = ptid_get_pid (child_ptid); int child_pid = child_ptid.pid ();
int child_lwp = ptid_get_lwp (child_ptid); int child_lwp = ptid_get_lwp (child_ptid);
kill_one_lwp (child_lwp); kill_one_lwp (child_lwp);
@ -3713,7 +3713,7 @@ linux_nat_target::kill ()
linux_fork_killall (); linux_fork_killall ();
else else
{ {
ptid_t ptid = ptid_t (ptid_get_pid (inferior_ptid)); ptid_t ptid = ptid_t (inferior_ptid.pid ());
/* Stop all threads before killing them, since ptrace requires /* Stop all threads before killing them, since ptrace requires
that the thread is stopped to sucessfully PTRACE_KILL. */ that the thread is stopped to sucessfully PTRACE_KILL. */
@ -3735,7 +3735,7 @@ linux_nat_target::kill ()
void void
linux_nat_target::mourn_inferior () linux_nat_target::mourn_inferior ()
{ {
int pid = ptid_get_pid (inferior_ptid); int pid = inferior_ptid.pid ();
purge_lwp_list (pid); purge_lwp_list (pid);
@ -3784,7 +3784,7 @@ linux_xfer_siginfo (enum target_object object,
pid = ptid_get_lwp (inferior_ptid); pid = ptid_get_lwp (inferior_ptid);
if (pid == 0) if (pid == 0)
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
if (offset > sizeof (siginfo)) if (offset > sizeof (siginfo))
return TARGET_XFER_E_IO; return TARGET_XFER_E_IO;
@ -3934,8 +3934,8 @@ linux_nat_target::pid_to_str (ptid_t ptid)
static char buf[64]; static char buf[64];
if (ptid_lwp_p (ptid) if (ptid_lwp_p (ptid)
&& (ptid_get_pid (ptid) != ptid_get_lwp (ptid) && (ptid.pid () != ptid_get_lwp (ptid)
|| num_lwps (ptid_get_pid (ptid)) > 1)) || num_lwps (ptid.pid ()) > 1))
{ {
snprintf (buf, sizeof (buf), "LWP %ld", ptid_get_lwp (ptid)); snprintf (buf, sizeof (buf), "LWP %ld", ptid_get_lwp (ptid));
return buf; return buf;
@ -4238,7 +4238,7 @@ linux_nat_target::static_tracepoint_markers_by_strid (const char *strid)
{ {
char s[IPA_CMD_BUF_SIZE]; char s[IPA_CMD_BUF_SIZE];
struct cleanup *old_chain; struct cleanup *old_chain;
int pid = ptid_get_pid (inferior_ptid); int pid = inferior_ptid.pid ();
std::vector<static_tracepoint_marker> markers; std::vector<static_tracepoint_marker> markers;
const char *p = s; const char *p = s;
ptid_t ptid = ptid_t (pid, 0, 0); ptid_t ptid = ptid_t (pid, 0, 0);
@ -4503,12 +4503,12 @@ linux_nat_target::thread_address_space (ptid_t ptid)
/* An (lwpid,0,0) ptid. Look up the lwp object to get at the /* An (lwpid,0,0) ptid. Look up the lwp object to get at the
tgid. */ tgid. */
lwp = find_lwp_pid (ptid); lwp = find_lwp_pid (ptid);
pid = ptid_get_pid (lwp->ptid); pid = lwp->ptid.pid ();
} }
else else
{ {
/* A (pid,lwpid,0) ptid. */ /* A (pid,lwpid,0) ptid. */
pid = ptid_get_pid (ptid); pid = ptid.pid ();
} }
inf = find_inferior_pid (pid); inf = find_inferior_pid (pid);
@ -4646,7 +4646,7 @@ linux_nat_get_siginfo (ptid_t ptid, siginfo_t *siginfo)
pid = ptid_get_lwp (ptid); pid = ptid_get_lwp (ptid);
if (pid == 0) if (pid == 0)
pid = ptid_get_pid (ptid); pid = ptid.pid ();
errno = 0; errno = 0;
ptrace (PTRACE_GETSIGINFO, pid, (PTRACE_TYPE_ARG3) 0, siginfo); ptrace (PTRACE_GETSIGINFO, pid, (PTRACE_TYPE_ARG3) 0, siginfo);

View File

@ -1386,7 +1386,7 @@ static int
find_signalled_thread (struct thread_info *info, void *data) find_signalled_thread (struct thread_info *info, void *data)
{ {
if (info->suspend.stop_signal != GDB_SIGNAL_0 if (info->suspend.stop_signal != GDB_SIGNAL_0
&& ptid_get_pid (info->ptid) == ptid_get_pid (inferior_ptid)) && info->ptid.pid () == inferior_ptid.pid ())
return 1; return 1;
return 0; return 0;
@ -1745,7 +1745,7 @@ linux_fill_prpsinfo (struct elf_internal_linux_prpsinfo *p)
gdb_assert (p != NULL); gdb_assert (p != NULL);
/* Obtaining PID and filename. */ /* Obtaining PID and filename. */
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
xsnprintf (filename, sizeof (filename), "/proc/%d/cmdline", (int) pid); xsnprintf (filename, sizeof (filename), "/proc/%d/cmdline", (int) pid);
/* The full name of the program which generated the corefile. */ /* The full name of the program which generated the corefile. */
gdb::unique_xmalloc_ptr<char> fname gdb::unique_xmalloc_ptr<char> fname
@ -1959,7 +1959,7 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size)
{ {
if (thr == signalled_thr) if (thr == signalled_thr)
continue; continue;
if (ptid_get_pid (thr->ptid) != ptid_get_pid (inferior_ptid)) if (thr->ptid.pid () != inferior_ptid.pid ())
continue; continue;
linux_corefile_thread (thr, &thread_args); linux_corefile_thread (thr, &thread_args);

View File

@ -230,7 +230,7 @@ add_thread_db_info (void *handle)
{ {
struct thread_db_info *info = XCNEW (struct thread_db_info); 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; info->handle = handle;
/* The workaround works by reading from /proc/pid/status, so it is /* 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. */ LWP. */
gdb_assert (ptid_get_lwp (ptid) != 0); 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. */ /* Access an lwp we know is stopped. */
info->proc_handle.thread = 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; struct thread_db_info *info;
info = get_thread_db_info (ptid_get_pid (child)); info = get_thread_db_info (child.pid ());
if (info == NULL) if (info == NULL)
return 0; 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 td_ta_map_lwp2thr uses ps_get_thread_area, but we can't use that
currently on core targets, as it uses ptrace directly. */ currently on core targets, as it uses ptrace directly. */
if (target_has_execution 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; info->td_ta_thr_iter_p = NULL;
else else
CHK (TDB_VERBOSE_DLSYM (info, td_ta_thr_iter)); 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) if (info->td_ta_thr_iter_p == NULL)
{ {
struct lwp_info *lp; struct lwp_info *lp;
int pid = ptid_get_pid (inferior_ptid); int pid = inferior_ptid.pid ();
thread_info *curr_thread = inferior_thread (); thread_info *curr_thread = inferior_thread ();
linux_stop_and_wait_all_lwps (); linux_stop_and_wait_all_lwps ();
ALL_LWPS (lp) ALL_LWPS (lp)
if (ptid_get_pid (lp->ptid) == pid) if (lp->ptid.pid () == pid)
thread_from_lwp (curr_thread, lp->ptid); thread_from_lwp (curr_thread, lp->ptid);
linux_unstop_all_lwps (); linux_unstop_all_lwps ();
@ -1003,7 +1003,7 @@ try_thread_db_load (const char *library, int check_auto_load_safe)
return 1; return 1;
/* This library "refused" to work on current inferior. */ /* 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; return 0;
} }
@ -1175,7 +1175,7 @@ thread_db_load (void)
{ {
struct thread_db_info *info; 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) if (info != NULL)
return 1; return 1;
@ -1284,7 +1284,7 @@ check_pid_namespace_match (void)
child's thread list, we'll mistakenly think it has no threads 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 since the thread PID fields won't match the PID we give to
libthread_db. */ 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 " warning (_ ("Target and debugger are in different PID "
"namespaces; thread lists and other data are " "namespaces; thread lists and other data are "
@ -1384,7 +1384,7 @@ thread_db_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
return ptid; 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 this process isn't using thread_db, we're done. */
if (info == NULL) 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 /* New image, it may or may not end up using thread_db. Assume
not unless we find otherwise. */ not unless we find otherwise. */
delete_thread_db_info (ptid_get_pid (ptid)); delete_thread_db_info (ptid.pid ());
if (!thread_db_list) if (!thread_db_list)
unpush_target (&the_thread_db_target); unpush_target (&the_thread_db_target);
@ -1410,7 +1410,7 @@ thread_db_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
void void
thread_db_target::mourn_inferior () thread_db_target::mourn_inferior ()
{ {
delete_thread_db_info (ptid_get_pid (inferior_ptid)); delete_thread_db_info (inferior_ptid.pid ());
beneath ()->mourn_inferior (); beneath ()->mourn_inferior ();
@ -1716,7 +1716,7 @@ thread_db_target::get_thread_local_address (ptid_t ptid,
{ {
td_err_e err; td_err_e err;
psaddr_t address; 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); thread_db_thread_info *priv = get_thread_db_thread_info (thread_info);
/* Finally, get the address of the variable. */ /* Finally, get the address of the variable. */
@ -1784,7 +1784,7 @@ ptid_t
thread_db_target::get_ada_task_ptid (long lwp, long thread) thread_db_target::get_ada_task_ptid (long lwp, long thread)
{ {
/* NPTL uses a 1:1 model, so the LWP id suffices. */ /* 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 void
@ -1793,9 +1793,9 @@ thread_db_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
struct thread_db_info *info; struct thread_db_info *info;
if (ptid_equal (ptid, minus_one_ptid)) 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 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 /* This workaround is only needed for child fork lwps stopped in a
PTRACE_O_TRACEFORK event. When the inferior is resumed, the 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 static void
maintenance_check_libthread_db (const char *args, int from_tty) 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; struct thread_db_info *info;
if (inferior_pid == 0) if (inferior_pid == 0)

View File

@ -117,7 +117,7 @@ m68kbsd_collect_fpregset (struct regcache *regcache,
void void
m68k_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) m68k_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{ {
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum)) if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum))
{ {
@ -146,7 +146,7 @@ m68k_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
void void
m68k_bsd_nat_target::store_registers (struct regcache *regcache, int regnum) m68k_bsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{ {
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum)) if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum))
{ {

View File

@ -968,7 +968,7 @@ mi_on_resume_1 (struct mi_interp *mi, ptid_t ptid)
current_token ? current_token : ""); current_token ? current_token : "");
} }
if (ptid_get_pid (ptid) == -1) if (ptid.pid () == -1)
fprintf_unfiltered (mi->raw_stdout, "*running,thread-id=\"all\"\n"); fprintf_unfiltered (mi->raw_stdout, "*running,thread-id=\"all\"\n");
else if (ptid_is_pid (ptid)) else if (ptid_is_pid (ptid))
{ {

View File

@ -246,7 +246,7 @@ proceed_thread (struct thread_info *thread, int pid)
if (thread->state != THREAD_STOPPED) if (thread->state != THREAD_STOPPED)
return; return;
if (pid != 0 && ptid_get_pid (thread->ptid) != pid) if (pid != 0 && thread->ptid.pid () != pid)
return; return;
switch_to_thread (thread); switch_to_thread (thread);
@ -348,7 +348,7 @@ interrupt_thread_callback (struct thread_info *thread, void *arg)
if (thread->state != THREAD_RUNNING) if (thread->state != THREAD_RUNNING)
return 0; return 0;
if (ptid_get_pid (thread->ptid) != pid) if (thread->ptid.pid () != pid)
return 0; return 0;
target_stop (thread->ptid); target_stop (thread->ptid);
@ -487,7 +487,7 @@ find_thread_of_process (struct thread_info *ti, void *p)
{ {
int pid = *(int *)p; int pid = *(int *)p;
if (ptid_get_pid (ti->ptid) == pid && ti->state != THREAD_EXITED) if (ti->ptid.pid () == pid && ti->state != THREAD_EXITED)
return 1; return 1;
return 0; return 0;
@ -623,7 +623,7 @@ collect_cores (struct thread_info *ti, void *xdata)
{ {
struct collect_cores_data *data = (struct collect_cores_data *) xdata; struct collect_cores_data *data = (struct collect_cores_data *) xdata;
if (ptid_get_pid (ti->ptid) == data->pid) if (ti->ptid.pid () == data->pid)
{ {
int core = target_core_of_thread (ti->ptid); int core = target_core_of_thread (ti->ptid);

View File

@ -462,7 +462,7 @@ mips_linux_nat_target::read_description ()
tid = ptid_get_lwp (inferior_ptid); tid = ptid_get_lwp (inferior_ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (inferior_ptid); tid = inferior_ptid.pid ();
errno = 0; errno = 0;
ptrace (PTRACE_PEEKUSER, tid, DSP_CONTROL, 0); ptrace (PTRACE_PEEKUSER, tid, DSP_CONTROL, 0);

View File

@ -49,7 +49,7 @@ getregs_supplies (struct gdbarch *gdbarch, int regno)
void void
mips_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno) mips_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{ {
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
struct gdbarch *gdbarch = regcache->arch (); struct gdbarch *gdbarch = regcache->arch ();
if (regno == -1 || getregs_supplies (gdbarch, regno)) if (regno == -1 || getregs_supplies (gdbarch, regno))
@ -79,7 +79,7 @@ mips_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
void void
mips_nbsd_nat_target::store_registers (struct regcache *regcache, int regno) mips_nbsd_nat_target::store_registers (struct regcache *regcache, int regno)
{ {
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
struct gdbarch *gdbarch = regcache->arch (); struct gdbarch *gdbarch = regcache->arch ();
if (regno == -1 || getregs_supplies (gdbarch, regno)) if (regno == -1 || getregs_supplies (gdbarch, regno))

View File

@ -89,7 +89,7 @@ void
mips64_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) mips64_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{ {
struct reg regs; struct reg regs;
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1) if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers")); perror_with_name (_("Couldn't get registers"));
@ -104,7 +104,7 @@ static void
mips64_obsd_nat_target::store_registers (struct regcache *regcache, int regnum) mips64_obsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{ {
struct reg regs; struct reg regs;
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1) if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers")); perror_with_name (_("Couldn't get registers"));

View File

@ -357,7 +357,7 @@ aarch64_notify_debug_reg_change (const struct aarch64_debug_reg_state *state,
int is_watchpoint, unsigned int idx) int is_watchpoint, unsigned int idx)
{ {
struct aarch64_dr_update_callback_param param; struct aarch64_dr_update_callback_param param;
ptid_t pid_ptid = ptid_t (ptid_get_pid (current_lwp_ptid ())); ptid_t pid_ptid = ptid_t (current_lwp_ptid ().pid ());
param.is_watchpoint = is_watchpoint; param.is_watchpoint = is_watchpoint;
param.idx = idx; param.idx = idx;

View File

@ -47,7 +47,7 @@ aarch64_linux_prepare_to_resume (struct lwp_info *lwp)
ptid_t ptid = ptid_of_lwp (lwp); ptid_t ptid = ptid_of_lwp (lwp);
int tid = ptid_get_lwp (ptid); int tid = ptid_get_lwp (ptid);
struct aarch64_debug_reg_state *state struct aarch64_debug_reg_state *state
= aarch64_get_debug_reg_state (ptid_get_pid (ptid)); = aarch64_get_debug_reg_state (ptid.pid ());
if (show_debug_regs) if (show_debug_regs)
debug_printf ("prepare_to_resume thread %d\n", tid); debug_printf ("prepare_to_resume thread %d\n", tid);

View File

@ -471,7 +471,7 @@ linux_enable_bts (ptid_t ptid, const struct btrace_config_bts *conf)
pid = ptid_get_lwp (ptid); pid = ptid_get_lwp (ptid);
if (pid == 0) if (pid == 0)
pid = ptid_get_pid (ptid); pid = ptid.pid ();
errno = 0; errno = 0;
scoped_fd fd (syscall (SYS_perf_event_open, &bts->attr, pid, -1, -1, 0)); scoped_fd fd (syscall (SYS_perf_event_open, &bts->attr, pid, -1, -1, 0));
@ -587,7 +587,7 @@ linux_enable_pt (ptid_t ptid, const struct btrace_config_pt *conf)
pid = ptid_get_lwp (ptid); pid = ptid_get_lwp (ptid);
if (pid == 0) if (pid == 0)
pid = ptid_get_pid (ptid); pid = ptid.pid ();
gdb::unique_xmalloc_ptr<btrace_target_info> tinfo gdb::unique_xmalloc_ptr<btrace_target_info> tinfo
(XCNEW (btrace_target_info)); (XCNEW (btrace_target_info));

View File

@ -70,7 +70,7 @@ linux_common_core_of_thread (ptid_t ptid)
int core; int core;
sprintf (filename, "/proc/%lld/task/%lld/stat", sprintf (filename, "/proc/%lld/task/%lld/stat",
(PID_T) ptid_get_pid (ptid), (PID_T) ptid_get_lwp (ptid)); (PID_T) ptid.pid (), (PID_T) ptid_get_lwp (ptid));
gdb_file_up f = gdb_fopen_cloexec (filename, "r"); gdb_file_up f = gdb_fopen_cloexec (filename, "r");
if (!f) if (!f)
return -1; return -1;

View File

@ -239,8 +239,8 @@ linux_proc_tid_get_name (ptid_t ptid)
static char comm_buf[TASK_COMM_LEN]; static char comm_buf[TASK_COMM_LEN];
char comm_path[100]; char comm_path[100];
const char *comm_val; const char *comm_val;
pid_t pid = ptid_get_pid (ptid); pid_t pid = ptid.pid ();
pid_t tid = ptid_lwp_p (ptid) ? ptid_get_lwp (ptid) : ptid_get_pid (ptid); pid_t tid = ptid_lwp_p (ptid) ? ptid_get_lwp (ptid) : ptid.pid ();
xsnprintf (comm_path, sizeof (comm_path), xsnprintf (comm_path, sizeof (comm_path),
"/proc/%ld/task/%ld/comm", (long) pid, (long) tid); "/proc/%ld/task/%ld/comm", (long) pid, (long) tid);

View File

@ -102,7 +102,7 @@ x86_linux_dr_get_addr (int regnum)
void void
x86_linux_dr_set_addr (int regnum, CORE_ADDR addr) x86_linux_dr_set_addr (int regnum, CORE_ADDR addr)
{ {
ptid_t pid_ptid = ptid_t (ptid_get_pid (current_lwp_ptid ())); ptid_t pid_ptid = ptid_t (current_lwp_ptid ().pid ());
gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR); gdb_assert (DR_FIRSTADDR <= regnum && regnum <= DR_LASTADDR);
@ -122,7 +122,7 @@ x86_linux_dr_get_control (void)
void void
x86_linux_dr_set_control (unsigned long control) x86_linux_dr_set_control (unsigned long control)
{ {
ptid_t pid_ptid = ptid_t (ptid_get_pid (current_lwp_ptid ())); ptid_t pid_ptid = ptid_t (current_lwp_ptid ().pid ());
iterate_over_lwps (pid_ptid, update_debug_registers_callback, NULL); iterate_over_lwps (pid_ptid, update_debug_registers_callback, NULL);
} }
@ -148,7 +148,7 @@ x86_linux_update_debug_registers (struct lwp_info *lwp)
if (lwp_debug_registers_changed (lwp)) if (lwp_debug_registers_changed (lwp))
{ {
struct x86_debug_reg_state *state struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (ptid)); = x86_debug_reg_state (ptid.pid ());
int i; int i;
/* Prior to Linux kernel 2.6.33 commit /* Prior to Linux kernel 2.6.33 commit

View File

@ -311,7 +311,7 @@ nto_procfs_target::thread_alive (ptid_t ptid)
int err; int err;
tid = ptid_get_tid (ptid); tid = ptid_get_tid (ptid);
pid = ptid_get_pid (ptid); pid = ptid.pid ();
if (kill (pid, 0) == -1) if (kill (pid, 0) == -1)
return false; return false;
@ -398,7 +398,7 @@ nto_procfs_target::update_thread_list ()
prune_threads (); prune_threads ();
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
status.tid = 1; status.tid = 1;
@ -746,7 +746,7 @@ do_attach (ptid_t ptid)
char path[PATH_MAX]; char path[PATH_MAX];
snprintf (path, PATH_MAX - 1, "%s%s/%d/as", snprintf (path, PATH_MAX - 1, "%s%s/%d/as",
(nodestr != NULL) ? nodestr : "", "/proc", ptid_get_pid (ptid)); (nodestr != NULL) ? nodestr : "", "/proc", ptid.pid ());
ctl_fd = open (path, O_RDWR); ctl_fd = open (path, O_RDWR);
if (ctl_fd == -1) if (ctl_fd == -1)
error (_("Couldn't open proc file %s, error %d (%s)"), path, errno, error (_("Couldn't open proc file %s, error %d (%s)"), path, errno,
@ -764,9 +764,9 @@ do_attach (ptid_t ptid)
if (devctl (ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status), 0) == EOK if (devctl (ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status), 0) == EOK
&& status.flags & _DEBUG_FLAG_STOPPED) && status.flags & _DEBUG_FLAG_STOPPED)
SignalKill (nto_node (), ptid_get_pid (ptid), 0, SIGCONT, 0, 0); SignalKill (nto_node (), ptid.pid (), 0, SIGCONT, 0, 0);
nto_init_solib_absolute_prefix (); nto_init_solib_absolute_prefix ();
return ptid_t (ptid_get_pid (ptid), 0, status.tid); return ptid_t (ptid.pid (), 0, status.tid);
} }
/* Ask the user what to do when an interrupt is received. */ /* Ask the user what to do when an interrupt is received. */
@ -873,7 +873,7 @@ nto_procfs_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
{ {
int waitval = 0; int waitval = 0;
waitpid (ptid_get_pid (inferior_ptid), &waitval, WNOHANG); waitpid (inferior_ptid.pid (), &waitval, WNOHANG);
if (exit_signo) if (exit_signo)
{ {
/* Abnormal death. */ /* Abnormal death. */
@ -1013,12 +1013,12 @@ nto_procfs_target::detach (inferior *inf, int from_tty)
target_announce_detach (); target_announce_detach ();
if (siggnal) if (siggnal)
SignalKill (nto_node (), ptid_get_pid (inferior_ptid), 0, 0, 0, 0); SignalKill (nto_node (), inferior_ptid.pid (), 0, 0, 0, 0);
close (ctl_fd); close (ctl_fd);
ctl_fd = -1; ctl_fd = -1;
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
inferior_ptid = null_ptid; inferior_ptid = null_ptid;
detach_inferior (pid); detach_inferior (pid);
init_thread_list (); init_thread_list ();
@ -1113,7 +1113,7 @@ nto_procfs_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
{ {
if (signal_to_pass != status.info.si_signo) if (signal_to_pass != status.info.si_signo)
{ {
SignalKill (nto_node (), ptid_get_pid (inferior_ptid), 0, SignalKill (nto_node (), inferior_ptid.pid (), 0,
signal_to_pass, 0, 0); signal_to_pass, 0, 0);
run.flags |= _DEBUG_RUN_CLRFLT | _DEBUG_RUN_CLRSIG; run.flags |= _DEBUG_RUN_CLRFLT | _DEBUG_RUN_CLRSIG;
} }
@ -1137,7 +1137,7 @@ nto_procfs_target::mourn_inferior ()
{ {
if (!ptid_equal (inferior_ptid, null_ptid)) if (!ptid_equal (inferior_ptid, null_ptid))
{ {
SignalKill (nto_node (), ptid_get_pid (inferior_ptid), 0, SIGKILL, 0, 0); SignalKill (nto_node (), inferior_ptid.pid (), 0, SIGKILL, 0, 0);
close (ctl_fd); close (ctl_fd);
} }
inferior_ptid = null_ptid; inferior_ptid = null_ptid;
@ -1468,7 +1468,7 @@ nto_procfs_target::pid_to_str (ptid_t ptid)
int pid, tid, n; int pid, tid, n;
struct tidinfo *tip; struct tidinfo *tip;
pid = ptid_get_pid (ptid); pid = ptid.pid ();
tid = ptid_get_tid (ptid); tid = ptid_get_tid (ptid);
n = snprintf (buf, 1023, "process %d", pid); n = snprintf (buf, 1023, "process %d", pid);

View File

@ -52,7 +52,7 @@ obsd_nat_target::pid_to_str (ptid_t ptid)
void void
obsd_nat_target::update_thread_list () obsd_nat_target::update_thread_list ()
{ {
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
struct ptrace_thread_state pts; struct ptrace_thread_state pts;
prune_threads (); prune_threads ();
@ -90,7 +90,7 @@ obsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
do do
{ {
pid = waitpid (ptid_get_pid (ptid), &status, 0); pid = waitpid (ptid.pid (), &status, 0);
save_errno = errno; save_errno = errno;
} }
while (pid == -1 && errno == EINTR); while (pid == -1 && errno == EINTR);
@ -110,7 +110,7 @@ obsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
} }
/* Ignore terminated detached child processes. */ /* Ignore terminated detached child processes. */
if (!WIFSTOPPED (status) && pid != ptid_get_pid (inferior_ptid)) if (!WIFSTOPPED (status) && pid != inferior_ptid.pid ())
pid = -1; pid = -1;
} }
while (pid == -1); while (pid == -1);
@ -142,7 +142,7 @@ obsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
gdb_assert (pe.pe_report_event == PTRACE_FORK); gdb_assert (pe.pe_report_event == PTRACE_FORK);
gdb_assert (pe.pe_other_pid == pid); gdb_assert (pe.pe_other_pid == pid);
if (fpid == ptid_get_pid (inferior_ptid)) if (fpid == inferior_ptid.pid ())
{ {
ourstatus->value.related_pid = ptid_t (pe.pe_other_pid); ourstatus->value.related_pid = ptid_t (pe.pe_other_pid);
return ptid_t (fpid); return ptid_t (fpid);

View File

@ -1226,7 +1226,7 @@ have_ptrace_hwdebug_interface (void)
tid = ptid_get_lwp (inferior_ptid); tid = ptid_get_lwp (inferior_ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (inferior_ptid); tid = inferior_ptid.pid ();
/* Check for kernel support for PowerPC HWDEBUG ptrace interface. */ /* Check for kernel support for PowerPC HWDEBUG ptrace interface. */
if (ptrace (PPC_PTRACE_GETHWDBGINFO, tid, 0, &hwdebug_info) >= 0) if (ptrace (PPC_PTRACE_GETHWDBGINFO, tid, 0, &hwdebug_info) >= 0)
@ -1298,7 +1298,7 @@ ppc_linux_nat_target::can_use_hw_breakpoint (enum bptype type, int cnt, int ot)
ptrace call will return -1. Fail in that case. */ ptrace call will return -1. Fail in that case. */
tid = ptid_get_lwp (ptid); tid = ptid_get_lwp (ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (ptid); tid = ptid.pid ();
if (ptrace (PTRACE_SET_DEBUGREG, tid, 0, 0) == -1) if (ptrace (PTRACE_SET_DEBUGREG, tid, 0, 0) == -1)
return 0; return 0;
@ -2185,7 +2185,7 @@ ppc_linux_nat_target::auxv_parse (gdb_byte **readptr,
{ {
int tid = ptid_get_lwp (inferior_ptid); int tid = ptid_get_lwp (inferior_ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (inferior_ptid); tid = inferior_ptid.pid ();
int sizeof_auxv_field = ppc_linux_target_wordsize (tid); int sizeof_auxv_field = ppc_linux_target_wordsize (tid);
@ -2212,7 +2212,7 @@ ppc_linux_nat_target::read_description ()
{ {
int tid = ptid_get_lwp (inferior_ptid); int tid = ptid_get_lwp (inferior_ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (inferior_ptid); tid = inferior_ptid.pid ();
if (have_ptrace_getsetevrregs) if (have_ptrace_getsetevrregs)
{ {

View File

@ -88,7 +88,7 @@ void
ppc_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) ppc_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{ {
struct gdbarch *gdbarch = regcache->arch (); struct gdbarch *gdbarch = regcache->arch ();
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum)) if (regnum == -1 || getregs_supplies (gdbarch, regnum))
{ {
@ -117,7 +117,7 @@ void
ppc_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum) ppc_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{ {
struct gdbarch *gdbarch = regcache->arch (); struct gdbarch *gdbarch = regcache->arch ();
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum)) if (regnum == -1 || getregs_supplies (gdbarch, regnum))
{ {

View File

@ -82,7 +82,7 @@ void
ppc_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) ppc_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{ {
struct reg regs; struct reg regs;
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1) if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers")); perror_with_name (_("Couldn't get registers"));
@ -116,7 +116,7 @@ void
ppc_obsd_nat_target::store_registers (struct regcache *regcache, int regnum) ppc_obsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{ {
struct reg regs; struct reg regs;
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1) if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers")); perror_with_name (_("Couldn't get registers"));

View File

@ -204,7 +204,7 @@ ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid,
pid_t pid_t
ps_getpid (struct ps_prochandle *ph) ps_getpid (struct ps_prochandle *ph)
{ {
return ptid_get_pid (ph->thread->ptid); return ph->thread->ptid.pid ();
} }
void void

View File

@ -1635,17 +1635,17 @@ procfs_find_LDT_entry (ptid_t ptid)
procinfo *pi; procinfo *pi;
/* Find procinfo for the lwp. */ /* Find procinfo for the lwp. */
if ((pi = find_procinfo (ptid_get_pid (ptid), ptid_get_lwp (ptid))) == NULL) if ((pi = find_procinfo (ptid.pid (), ptid_get_lwp (ptid))) == NULL)
{ {
warning (_("procfs_find_LDT_entry: could not find procinfo for %d:%ld."), warning (_("procfs_find_LDT_entry: could not find procinfo for %d:%ld."),
ptid_get_pid (ptid), ptid_get_lwp (ptid)); ptid.pid (), ptid_get_lwp (ptid));
return NULL; return NULL;
} }
/* get its general registers. */ /* get its general registers. */
if ((gregs = proc_get_gregs (pi)) == NULL) if ((gregs = proc_get_gregs (pi)) == NULL)
{ {
warning (_("procfs_find_LDT_entry: could not read gregs for %d:%ld."), warning (_("procfs_find_LDT_entry: could not read gregs for %d:%ld."),
ptid_get_pid (ptid), ptid_get_lwp (ptid)); ptid.pid (), ptid_get_lwp (ptid));
return NULL; return NULL;
} }
/* Now extract the GS register's lower 16 bits. */ /* Now extract the GS register's lower 16 bits. */
@ -1910,7 +1910,7 @@ procfs_target::attach (const char *args, int from_tty)
void void
procfs_target::detach (inferior *inf, int from_tty) procfs_target::detach (inferior *inf, int from_tty)
{ {
int pid = ptid_get_pid (inferior_ptid); int pid = inferior_ptid.pid ();
if (from_tty) if (from_tty)
{ {
@ -1940,14 +1940,14 @@ do_attach (ptid_t ptid)
int fail; int fail;
int lwpid; int lwpid;
if ((pi = create_procinfo (ptid_get_pid (ptid), 0)) == NULL) if ((pi = create_procinfo (ptid.pid (), 0)) == NULL)
perror (_("procfs: out of memory in 'attach'")); perror (_("procfs: out of memory in 'attach'"));
if (!open_procinfo_files (pi, FD_CTL)) if (!open_procinfo_files (pi, FD_CTL))
{ {
fprintf_filtered (gdb_stderr, "procfs:%d -- ", __LINE__); fprintf_filtered (gdb_stderr, "procfs:%d -- ", __LINE__);
sprintf (errmsg, "do_attach: couldn't open /proc file for process %d", sprintf (errmsg, "do_attach: couldn't open /proc file for process %d",
ptid_get_pid (ptid)); ptid.pid ());
dead_procinfo (pi, errmsg, NOKILL); dead_procinfo (pi, errmsg, NOKILL);
} }
@ -2008,7 +2008,7 @@ do_detach ()
procinfo *pi; procinfo *pi;
/* Find procinfo for the main process. */ /* Find procinfo for the main process. */
pi = find_procinfo_or_die (ptid_get_pid (inferior_ptid), pi = find_procinfo_or_die (inferior_ptid.pid (),
0); /* FIXME: threads */ 0); /* FIXME: threads */
if (!proc_set_traced_signals (pi, &pi->saved_sigset)) if (!proc_set_traced_signals (pi, &pi->saved_sigset))
@ -2064,7 +2064,7 @@ procfs_target::fetch_registers (struct regcache *regcache, int regnum)
gdb_gregset_t *gregs; gdb_gregset_t *gregs;
procinfo *pi; procinfo *pi;
ptid_t ptid = regcache->ptid (); ptid_t ptid = regcache->ptid ();
int pid = ptid_get_pid (ptid); int pid = ptid.pid ();
int tid = ptid_get_lwp (ptid); int tid = ptid_get_lwp (ptid);
struct gdbarch *gdbarch = regcache->arch (); struct gdbarch *gdbarch = regcache->arch ();
@ -2113,7 +2113,7 @@ procfs_target::store_registers (struct regcache *regcache, int regnum)
gdb_gregset_t *gregs; gdb_gregset_t *gregs;
procinfo *pi; procinfo *pi;
ptid_t ptid = regcache->ptid (); ptid_t ptid = regcache->ptid ();
int pid = ptid_get_pid (ptid); int pid = ptid.pid ();
int tid = ptid_get_lwp (ptid); int tid = ptid_get_lwp (ptid);
struct gdbarch *gdbarch = regcache->arch (); struct gdbarch *gdbarch = regcache->arch ();
@ -2211,7 +2211,7 @@ wait_again:
retval = ptid_t (-1); retval = ptid_t (-1);
/* Find procinfo for main process. */ /* Find procinfo for main process. */
pi = find_procinfo_or_die (ptid_get_pid (inferior_ptid), 0); pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
if (pi) if (pi)
{ {
/* We must assume that the status is stale now... */ /* We must assume that the status is stale now... */
@ -2238,10 +2238,10 @@ wait_again:
wait_retval = ::wait (&wstat); /* "wait" for the child's exit. */ wait_retval = ::wait (&wstat); /* "wait" for the child's exit. */
/* Wrong child? */ /* Wrong child? */
if (wait_retval != ptid_get_pid (inferior_ptid)) if (wait_retval != inferior_ptid.pid ())
error (_("procfs: couldn't stop " error (_("procfs: couldn't stop "
"process %d: wait returned %d."), "process %d: wait returned %d."),
ptid_get_pid (inferior_ptid), wait_retval); inferior_ptid.pid (), wait_retval);
/* FIXME: might I not just use waitpid? /* FIXME: might I not just use waitpid?
Or try find_procinfo to see if I know about this child? */ Or try find_procinfo to see if I know about this child? */
retval = ptid_t (wait_retval); retval = ptid_t (wait_retval);
@ -2524,7 +2524,7 @@ wait_again:
} }
/* Got this far without error: If retval isn't in the /* Got this far without error: If retval isn't in the
threads database, add it. */ threads database, add it. */
if (ptid_get_pid (retval) > 0 && if (retval.pid () > 0 &&
!ptid_equal (retval, inferior_ptid) && !ptid_equal (retval, inferior_ptid) &&
!in_thread_list (retval)) !in_thread_list (retval))
{ {
@ -2532,9 +2532,9 @@ wait_again:
GDB's list and to our own. If we don't create a GDB's list and to our own. If we don't create a
procinfo, resume may be unhappy later. */ procinfo, resume may be unhappy later. */
add_thread (retval); add_thread (retval);
if (find_procinfo (ptid_get_pid (retval), if (find_procinfo (retval.pid (),
ptid_get_lwp (retval)) == NULL) ptid_get_lwp (retval)) == NULL)
create_procinfo (ptid_get_pid (retval), create_procinfo (retval.pid (),
ptid_get_lwp (retval)); ptid_get_lwp (retval));
} }
} }
@ -2591,7 +2591,7 @@ procfs_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf,
int nbytes; int nbytes;
/* Find procinfo for main process. */ /* Find procinfo for main process. */
pi = find_procinfo_or_die (ptid_get_pid (inferior_ptid), 0); pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
if (pi->as_fd == 0 && if (pi->as_fd == 0 &&
open_procinfo_files (pi, FD_AS) == 0) open_procinfo_files (pi, FD_AS) == 0)
{ {
@ -2728,7 +2728,7 @@ procfs_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
to proc_run_process (for use in the prrun struct by ioctl). */ to proc_run_process (for use in the prrun struct by ioctl). */
/* Find procinfo for main process. */ /* Find procinfo for main process. */
pi = find_procinfo_or_die (ptid_get_pid (inferior_ptid), 0); pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
/* First cut: ignore pid argument. */ /* First cut: ignore pid argument. */
errno = 0; errno = 0;
@ -2748,11 +2748,11 @@ procfs_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
/* Void the process procinfo's caches. */ /* Void the process procinfo's caches. */
invalidate_cache (NULL, pi, NULL); invalidate_cache (NULL, pi, NULL);
if (ptid_get_pid (ptid) != -1) if (ptid.pid () != -1)
{ {
/* Resume a specific thread, presumably suppressing the /* Resume a specific thread, presumably suppressing the
others. */ others. */
thread = find_procinfo (ptid_get_pid (ptid), ptid_get_lwp (ptid)); thread = find_procinfo (ptid.pid (), ptid_get_lwp (ptid));
if (thread != NULL) if (thread != NULL)
{ {
if (thread->tid != 0) if (thread->tid != 0)
@ -2788,7 +2788,7 @@ void
procfs_target::pass_signals (int numsigs, unsigned char *pass_signals) procfs_target::pass_signals (int numsigs, unsigned char *pass_signals)
{ {
sigset_t signals; sigset_t signals;
procinfo *pi = find_procinfo_or_die (ptid_get_pid (inferior_ptid), 0); procinfo *pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
int signo; int signo;
prfillset (&signals); prfillset (&signals);
@ -2855,7 +2855,7 @@ procfs_target::kill ()
if (!ptid_equal (inferior_ptid, null_ptid)) /* ? */ if (!ptid_equal (inferior_ptid, null_ptid)) /* ? */
{ {
/* Find procinfo for main process. */ /* Find procinfo for main process. */
procinfo *pi = find_procinfo (ptid_get_pid (inferior_ptid), 0); procinfo *pi = find_procinfo (inferior_ptid.pid (), 0);
if (pi) if (pi)
unconditionally_kill_inferior (pi); unconditionally_kill_inferior (pi);
@ -2873,7 +2873,7 @@ procfs_target::mourn_inferior ()
if (!ptid_equal (inferior_ptid, null_ptid)) if (!ptid_equal (inferior_ptid, null_ptid))
{ {
/* Find procinfo for main process. */ /* Find procinfo for main process. */
pi = find_procinfo (ptid_get_pid (inferior_ptid), 0); pi = find_procinfo (inferior_ptid.pid (), 0);
if (pi) if (pi)
destroy_procinfo (pi); destroy_procinfo (pi);
} }
@ -3162,7 +3162,7 @@ procfs_target::update_thread_list ()
prune_threads (); prune_threads ();
/* Find procinfo for main process. */ /* Find procinfo for main process. */
pi = find_procinfo_or_die (ptid_get_pid (inferior_ptid), 0); pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
proc_update_threads (pi); proc_update_threads (pi);
proc_iterate_over_threads (pi, procfs_notice_thread, NULL); proc_iterate_over_threads (pi, procfs_notice_thread, NULL);
} }
@ -3177,7 +3177,7 @@ procfs_target::thread_alive (ptid_t ptid)
int proc, thread; int proc, thread;
procinfo *pi; procinfo *pi;
proc = ptid_get_pid (ptid); proc = ptid.pid ();
thread = ptid_get_lwp (ptid); thread = ptid_get_lwp (ptid);
/* If I don't know it, it ain't alive! */ /* If I don't know it, it ain't alive! */
if ((pi = find_procinfo (proc, thread)) == NULL) if ((pi = find_procinfo (proc, thread)) == NULL)
@ -3204,7 +3204,7 @@ procfs_target::pid_to_str (ptid_t ptid)
static char buf[80]; static char buf[80];
if (ptid_get_lwp (ptid) == 0) if (ptid_get_lwp (ptid) == 0)
sprintf (buf, "process %d", ptid_get_pid (ptid)); sprintf (buf, "process %d", ptid.pid ());
else else
sprintf (buf, "LWP %ld", ptid_get_lwp (ptid)); sprintf (buf, "LWP %ld", ptid_get_lwp (ptid));
@ -3220,8 +3220,8 @@ procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
int pflags = 0; int pflags = 0;
procinfo *pi; procinfo *pi;
pi = find_procinfo_or_die (ptid_get_pid (ptid) == -1 ? pi = find_procinfo_or_die (ptid.pid () == -1 ?
ptid_get_pid (inferior_ptid) : ptid_get_pid (ptid), inferior_ptid.pid () : ptid.pid (),
0); 0);
/* Translate from GDB's flags to /proc's. */ /* Translate from GDB's flags to /proc's. */
@ -3298,7 +3298,7 @@ procfs_target::stopped_by_watchpoint ()
{ {
procinfo *pi; procinfo *pi;
pi = find_procinfo_or_die (ptid_get_pid (inferior_ptid), 0); pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
if (proc_flags (pi) & (PR_STOPPED | PR_ISTOP)) if (proc_flags (pi) & (PR_STOPPED | PR_ISTOP))
{ {
@ -3322,7 +3322,7 @@ procfs_target::stopped_data_address (CORE_ADDR *addr)
{ {
procinfo *pi; procinfo *pi;
pi = find_procinfo_or_die (ptid_get_pid (inferior_ptid), 0); pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
return proc_watchpoint_address (pi, addr); return proc_watchpoint_address (pi, addr);
} }
@ -3455,7 +3455,7 @@ find_memory_regions_callback (struct prmap *map,
int int
procfs_target::find_memory_regions (find_memory_region_ftype func, void *data) procfs_target::find_memory_regions (find_memory_region_ftype func, void *data)
{ {
procinfo *pi = find_procinfo_or_die (ptid_get_pid (inferior_ptid), 0); procinfo *pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
return iterate_over_mappings (pi, func, data, return iterate_over_mappings (pi, func, data,
find_memory_regions_callback); find_memory_regions_callback);
@ -3584,7 +3584,7 @@ procfs_target::info_proc (const char *args, enum info_proc_what what)
} }
} }
if (pid == 0) if (pid == 0)
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
if (pid == 0) if (pid == 0)
error (_("No current process: you must name one.")); error (_("No current process: you must name one."));
else else
@ -3678,13 +3678,13 @@ proc_trace_syscalls (const char *args, int from_tty, int entry_or_exit, int mode
{ {
procinfo *pi; procinfo *pi;
if (ptid_get_pid (inferior_ptid) <= 0) if (inferior_ptid.pid () <= 0)
error (_("you must be debugging a process to use this command.")); error (_("you must be debugging a process to use this command."));
if (args == NULL || args[0] == 0) if (args == NULL || args[0] == 0)
error_no_arg (_("system call to trace")); error_no_arg (_("system call to trace"));
pi = find_procinfo_or_die (ptid_get_pid (inferior_ptid), 0); pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
if (isdigit (args[0])) if (isdigit (args[0]))
{ {
const int syscallnum = atoi (args); const int syscallnum = atoi (args);
@ -3764,7 +3764,7 @@ procfs_do_thread_registers (bfd *obfd, ptid_t ptid,
gdb_fpregset_t fpregs; gdb_fpregset_t fpregs;
unsigned long merged_pid; unsigned long merged_pid;
merged_pid = ptid_get_lwp (ptid) << 16 | ptid_get_pid (ptid); merged_pid = ptid_get_lwp (ptid) << 16 | ptid.pid ();
/* This part is the old method for fetching registers. /* This part is the old method for fetching registers.
It should be replaced by the newer one using regsets It should be replaced by the newer one using regsets
@ -3821,7 +3821,7 @@ static int
find_signalled_thread (struct thread_info *info, void *data) find_signalled_thread (struct thread_info *info, void *data)
{ {
if (info->suspend.stop_signal != GDB_SIGNAL_0 if (info->suspend.stop_signal != GDB_SIGNAL_0
&& ptid_get_pid (info->ptid) == ptid_get_pid (inferior_ptid)) && info->ptid.pid () == inferior_ptid.pid ())
return 1; return 1;
return 0; return 0;
@ -3847,7 +3847,7 @@ procfs_target::make_corefile_notes (bfd *obfd, int *note_size)
gdb_fpregset_t fpregs; gdb_fpregset_t fpregs;
char fname[16] = {'\0'}; char fname[16] = {'\0'};
char psargs[80] = {'\0'}; char psargs[80] = {'\0'};
procinfo *pi = find_procinfo_or_die (ptid_get_pid (inferior_ptid), 0); procinfo *pi = find_procinfo_or_die (inferior_ptid.pid (), 0);
char *note_data = NULL; char *note_data = NULL;
char *inf_args; char *inf_args;
struct procfs_corefile_thread_data thread_args; struct procfs_corefile_thread_data thread_args;
@ -3881,7 +3881,7 @@ procfs_target::make_corefile_notes (bfd *obfd, int *note_size)
fill_gregset (get_current_regcache (), &gregs, -1); fill_gregset (get_current_regcache (), &gregs, -1);
note_data = elfcore_write_pstatus (obfd, note_data, note_size, note_data = elfcore_write_pstatus (obfd, note_data, note_size,
ptid_get_pid (inferior_ptid), inferior_ptid.pid (),
stop_signal, &gregs); stop_signal, &gregs);
thread_args.obfd = obfd; thread_args.obfd = obfd;

View File

@ -266,7 +266,7 @@ gdbpy_create_ptid_object (ptid_t ptid)
if (!ret) if (!ret)
return NULL; return NULL;
pid = ptid_get_pid (ptid); pid = ptid.pid ();
lwp = ptid_get_lwp (ptid); lwp = ptid_get_lwp (ptid);
tid = ptid_get_tid (ptid); tid = ptid_get_tid (ptid);

View File

@ -211,7 +211,7 @@ get_base_thread_from_ravenscar_task (ptid_t ptid)
return ptid; return ptid;
base_cpu = ravenscar_get_thread_base_cpu (ptid); base_cpu = ravenscar_get_thread_base_cpu (ptid);
return ptid_t (ptid_get_pid (ptid), base_cpu, 0); return ptid_t (ptid.pid (), base_cpu, 0);
} }
/* Fetch the ravenscar running thread from target memory and /* Fetch the ravenscar running thread from target memory and
@ -384,7 +384,7 @@ ravenscar_active_task (int cpu)
if (tid == 0) if (tid == 0)
return null_ptid; return null_ptid;
else else
return ptid_t (ptid_get_pid (base_ptid), 0, tid); return ptid_t (base_ptid.pid (), 0, tid);
} }
const char * const char *
@ -571,7 +571,7 @@ ravenscar_inferior_created (struct target_ops *target, int from_tty)
ptid_t ptid_t
ravenscar_thread_target::get_ada_task_ptid (long lwp, long thread) ravenscar_thread_target::get_ada_task_ptid (long lwp, long thread)
{ {
return ptid_t (ptid_get_pid (base_ptid), 0, thread); return ptid_t (base_ptid.pid (), 0, thread);
} }
/* Command-list for the "set/show ravenscar" prefix command. */ /* Command-list for the "set/show ravenscar" prefix command. */

View File

@ -366,7 +366,7 @@ cmd_record_save (const char *args, int from_tty)
{ {
/* Default recfile name is "gdb_record.PID". */ /* Default recfile name is "gdb_record.PID". */
xsnprintf (recfilename_buffer, sizeof (recfilename_buffer), xsnprintf (recfilename_buffer, sizeof (recfilename_buffer),
"gdb_record.%d", ptid_get_pid (inferior_ptid)); "gdb_record.%d", inferior_ptid.pid ());
recfilename = recfilename_buffer; recfilename = recfilename_buffer;
} }

View File

@ -281,7 +281,7 @@ static struct sim_inferior_data *
get_sim_inferior_data_by_ptid (ptid_t ptid, int sim_instance_needed) get_sim_inferior_data_by_ptid (ptid_t ptid, int sim_instance_needed)
{ {
struct inferior *inf; struct inferior *inf;
int pid = ptid_get_pid (ptid); int pid = ptid.pid ();
if (pid <= 0) if (pid <= 0)
return NULL; return NULL;
@ -686,7 +686,7 @@ gdbsim_target::create_inferior (const char *exec_file,
error (_("Unable to create sim inferior.")); error (_("Unable to create sim inferior."));
inferior_ptid = sim_data->remote_sim_ptid; inferior_ptid = sim_data->remote_sim_ptid;
inferior_appeared (current_inferior (), ptid_get_pid (inferior_ptid)); inferior_appeared (current_inferior (), inferior_ptid.pid ());
add_thread_silent (inferior_ptid); add_thread_silent (inferior_ptid);
insert_breakpoints (); /* Needed to get correct instruction insert_breakpoints (); /* Needed to get correct instruction
@ -1009,7 +1009,7 @@ gdbsim_target::wait (ptid_t ptid, struct target_waitstatus *status, int options)
sim_data = get_sim_inferior_data_by_ptid (ptid, SIM_INSTANCE_NEEDED); sim_data = get_sim_inferior_data_by_ptid (ptid, SIM_INSTANCE_NEEDED);
if (sim_data == NULL) if (sim_data == NULL)
error (_("Unable to wait for pid %d. Inferior not found."), error (_("Unable to wait for pid %d. Inferior not found."),
ptid_get_pid (ptid)); ptid.pid ());
inferior_ptid = ptid; inferior_ptid = ptid;
} }

View File

@ -2433,10 +2433,10 @@ remote_target::remote_notice_new_inferior (ptid_t currthread, int executing)
if (!in_thread_list (currthread)) if (!in_thread_list (currthread))
{ {
struct inferior *inf = NULL; struct inferior *inf = NULL;
int pid = ptid_get_pid (currthread); int pid = currthread.pid ();
if (ptid_is_pid (inferior_ptid) if (ptid_is_pid (inferior_ptid)
&& pid == ptid_get_pid (inferior_ptid)) && pid == inferior_ptid.pid ())
{ {
/* inferior_ptid has no thread member yet. This can happen /* inferior_ptid has no thread member yet. This can happen
with the vAttach -> remote_wait,"TAAthread:" path if the with the vAttach -> remote_wait,"TAAthread:" path if the
@ -2468,13 +2468,13 @@ remote_target::remote_notice_new_inferior (ptid_t currthread, int executing)
extended-remote which already was debugging an inferior, we extended-remote which already was debugging an inferior, we
may not know about it yet. Add it before adding its child may not know about it yet. Add it before adding its child
thread, so notifications are emitted in a sensible order. */ thread, so notifications are emitted in a sensible order. */
if (find_inferior_pid (ptid_get_pid (currthread)) == NULL) if (find_inferior_pid (currthread.pid ()) == NULL)
{ {
struct remote_state *rs = get_remote_state (); struct remote_state *rs = get_remote_state ();
int fake_pid_p = !remote_multi_process_p (rs); int fake_pid_p = !remote_multi_process_p (rs);
inf = remote_add_inferior (fake_pid_p, inf = remote_add_inferior (fake_pid_p,
ptid_get_pid (currthread), -1, 1); currthread.pid (), -1, 1);
} }
/* This is really a new thread. Add it. */ /* This is really a new thread. Add it. */
@ -2767,7 +2767,7 @@ remote_target::set_general_process ()
/* We only need to change the remote current thread if it's pointing /* We only need to change the remote current thread if it's pointing
at some other process. */ at some other process. */
if (ptid_get_pid (rs->general_thread) != ptid_get_pid (inferior_ptid)) if (rs->general_thread.pid () != inferior_ptid.pid ())
set_general_thread (inferior_ptid); set_general_thread (inferior_ptid);
} }
@ -2782,7 +2782,7 @@ remote_thread_always_alive (ptid_t ptid)
/* The main thread is always alive. */ /* The main thread is always alive. */
return 1; return 1;
if (ptid_get_pid (ptid) != 0 && ptid_get_lwp (ptid) == 0) if (ptid.pid () != 0 && ptid_get_lwp (ptid) == 0)
/* The main thread is always alive. This can happen after a /* The main thread is always alive. This can happen after a
vAttach, if the remote side doesn't support vAttach, if the remote side doesn't support
multi-threading. */ multi-threading. */
@ -2918,7 +2918,7 @@ remote_target::write_ptid (char *buf, const char *endbuf, ptid_t ptid)
if (remote_multi_process_p (rs)) if (remote_multi_process_p (rs))
{ {
pid = ptid_get_pid (ptid); pid = ptid.pid ();
if (pid < 0) if (pid < 0)
buf += xsnprintf (buf, endbuf - buf, "p-%x.", -pid); buf += xsnprintf (buf, endbuf - buf, "p-%x.", -pid);
else else
@ -2974,9 +2974,9 @@ read_ptid (const char *buf, const char **obuf)
then since there's no way to know the pid of the reported then since there's no way to know the pid of the reported
threads, use the magic number. */ threads, use the magic number. */
if (ptid_equal (inferior_ptid, null_ptid)) if (ptid_equal (inferior_ptid, null_ptid))
pid = ptid_get_pid (magic_null_ptid); pid = magic_null_ptid.pid ();
else else
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
if (obuf) if (obuf)
*obuf = pp; *obuf = pp;
@ -3839,7 +3839,7 @@ remote_target::extra_thread_info (thread_info *tp)
_("remote_threads_extra_info")); _("remote_threads_extra_info"));
if (ptid_equal (tp->ptid, magic_null_ptid) if (ptid_equal (tp->ptid, magic_null_ptid)
|| (ptid_get_pid (tp->ptid) != 0 && ptid_get_lwp (tp->ptid) == 0)) || (tp->ptid.pid () != 0 && ptid_get_lwp (tp->ptid) == 0))
/* This is the main thread which was added by GDB. The remote /* This is the main thread which was added by GDB. The remote
server doesn't know about it. */ server doesn't know about it. */
return NULL; return NULL;
@ -3972,7 +3972,7 @@ remote_target::static_tracepoint_markers_by_strid (const char *strid)
ptid_t ptid_t
remote_target::get_ada_task_ptid (long lwp, long thread) remote_target::get_ada_task_ptid (long lwp, long thread)
{ {
return ptid_t (ptid_get_pid (inferior_ptid), lwp, 0); return ptid_t (inferior_ptid.pid (), lwp, 0);
} }
@ -4310,7 +4310,7 @@ remote_target::add_current_inferior_and_thread (char *wait_status)
fake_pid_p = 1; fake_pid_p = 1;
} }
remote_add_inferior (fake_pid_p, ptid_get_pid (curr_ptid), -1, 1); remote_add_inferior (fake_pid_p, curr_ptid.pid (), -1, 1);
/* Add the main thread and switch to it. Don't try reading /* Add the main thread and switch to it. Don't try reading
registers yet, since we haven't fetched the target description registers yet, since we haven't fetched the target description
@ -5653,7 +5653,7 @@ remote_target::remote_detach_pid (int pid)
void void
remote_target::remote_detach_1 (inferior *inf, int from_tty) remote_target::remote_detach_1 (inferior *inf, int from_tty)
{ {
int pid = ptid_get_pid (inferior_ptid); int pid = inferior_ptid.pid ();
struct remote_state *rs = get_remote_state (); struct remote_state *rs = get_remote_state ();
int is_fork_parent; int is_fork_parent;
@ -5737,7 +5737,7 @@ remote_target::follow_fork (int follow_child, int detach_fork)
pid_t child_pid; pid_t child_pid;
child_ptid = inferior_thread ()->pending_follow.value.related_pid; child_ptid = inferior_thread ()->pending_follow.value.related_pid;
child_pid = ptid_get_pid (child_ptid); child_pid = child_ptid.pid ();
remote_detach_pid (child_pid); remote_detach_pid (child_pid);
} }
@ -6037,7 +6037,7 @@ remote_target::append_resumption (char *p, char *endp,
ptid_t nptid; ptid_t nptid;
/* All (-1) threads of process. */ /* All (-1) threads of process. */
nptid = ptid_t (ptid_get_pid (ptid), -1, 0); nptid = ptid_t (ptid.pid (), -1, 0);
p += xsnprintf (p, endp - p, ":"); p += xsnprintf (p, endp - p, ":");
p = write_ptid (p, endp, nptid); p = write_ptid (p, endp, nptid);
@ -6615,7 +6615,7 @@ remote_target::remote_stop_ns (ptid_t ptid)
if (ptid_is_pid (ptid)) if (ptid_is_pid (ptid))
/* All (-1) threads of process. */ /* All (-1) threads of process. */
nptid = ptid_t (ptid_get_pid (ptid), -1, 0); nptid = ptid_t (ptid.pid (), -1, 0);
else else
{ {
/* Small optimization: if we already have a stop reply for /* Small optimization: if we already have a stop reply for
@ -6939,7 +6939,7 @@ is_pending_fork_parent (struct target_waitstatus *ws, int event_pid,
if (ws->kind == TARGET_WAITKIND_FORKED if (ws->kind == TARGET_WAITKIND_FORKED
|| ws->kind == TARGET_WAITKIND_VFORKED) || ws->kind == TARGET_WAITKIND_VFORKED)
{ {
if (event_pid == -1 || event_pid == ptid_get_pid (thread_ptid)) if (event_pid == -1 || event_pid == thread_ptid.pid ())
return 1; return 1;
} }
@ -7054,7 +7054,7 @@ remote_target::discard_pending_stop_replies (struct inferior *inf)
reply = (struct stop_reply *) rns->pending_event[notif_client_stop.id]; reply = (struct stop_reply *) rns->pending_event[notif_client_stop.id];
/* Discard the in-flight notification. */ /* Discard the in-flight notification. */
if (reply != NULL && ptid_get_pid (reply->ptid) == inf->pid) if (reply != NULL && reply->ptid.pid () == inf->pid)
{ {
stop_reply_xfree (reply); stop_reply_xfree (reply);
rns->pending_event[notif_client_stop.id] = NULL; rns->pending_event[notif_client_stop.id] = NULL;
@ -7508,7 +7508,7 @@ Packet: '%s'\n"),
} }
/* If no process is specified, assume inferior_ptid. */ /* If no process is specified, assume inferior_ptid. */
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
if (*p == '\0') if (*p == '\0')
; ;
else if (*p == ';') else if (*p == ';')
@ -9718,7 +9718,7 @@ void
remote_target::kill () remote_target::kill ()
{ {
int res = -1; int res = -1;
int pid = ptid_get_pid (inferior_ptid); int pid = inferior_ptid.pid ();
struct remote_state *rs = get_remote_state (); struct remote_state *rs = get_remote_state ();
if (packet_support (PACKET_vKill) != PACKET_DISABLE) if (packet_support (PACKET_vKill) != PACKET_DISABLE)
@ -11320,7 +11320,7 @@ static void
threadalive_test (const char *cmd, int tty) threadalive_test (const char *cmd, int tty)
{ {
int sample_thread = SAMPLE_THREAD; int sample_thread = SAMPLE_THREAD;
int pid = ptid_get_pid (inferior_ptid); int pid = inferior_ptid.pid ();
ptid_t ptid = ptid_t (pid, sample_thread, 0); ptid_t ptid = ptid_t (pid, sample_thread, 0);
if (remote_thread_alive (ptid)) if (remote_thread_alive (ptid))
@ -11472,7 +11472,7 @@ remote_target::pid_to_str (ptid_t ptid)
return normal_pid_to_str (ptid); return normal_pid_to_str (ptid);
else else
xsnprintf (buf, sizeof buf, "Thread %d.%ld", xsnprintf (buf, sizeof buf, "Thread %d.%ld",
ptid_get_pid (ptid), ptid_get_lwp (ptid)); ptid.pid (), ptid_get_lwp (ptid));
else else
xsnprintf (buf, sizeof buf, "Thread %ld", xsnprintf (buf, sizeof buf, "Thread %ld",
ptid_get_lwp (ptid)); ptid_get_lwp (ptid));

View File

@ -191,7 +191,7 @@ fetch_register (struct regcache *regcache, int regno)
struct gdbarch *gdbarch = regcache->arch (); struct gdbarch *gdbarch = regcache->arch ();
int addr[PPC_MAX_REGISTER_SIZE]; int addr[PPC_MAX_REGISTER_SIZE];
int nr, isfloat; int nr, isfloat;
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
/* Retrieved values may be -1, so infer errors from errno. */ /* Retrieved values may be -1, so infer errors from errno. */
errno = 0; errno = 0;
@ -250,7 +250,7 @@ store_register (struct regcache *regcache, int regno)
struct gdbarch *gdbarch = regcache->arch (); struct gdbarch *gdbarch = regcache->arch ();
int addr[PPC_MAX_REGISTER_SIZE]; int addr[PPC_MAX_REGISTER_SIZE];
int nr, isfloat; int nr, isfloat;
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
/* Fetch the register's value from the register cache. */ /* Fetch the register's value from the register cache. */
regcache->raw_collect (regno, addr); regcache->raw_collect (regno, addr);
@ -393,7 +393,7 @@ rs6000_nat_target::xfer_partial (enum target_object object,
ULONGEST offset, ULONGEST len, ULONGEST offset, ULONGEST len,
ULONGEST *xfered_len) ULONGEST *xfered_len)
{ {
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
int arch64 = ARCH64 (); int arch64 = ARCH64 ();
switch (object) switch (object)
@ -506,7 +506,7 @@ rs6000_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
do do
{ {
pid = waitpid (ptid_get_pid (ptid), &status, 0); pid = waitpid (ptid.pid (), &status, 0);
save_errno = errno; save_errno = errno;
} }
while (pid == -1 && errno == EINTR); while (pid == -1 && errno == EINTR);
@ -526,7 +526,7 @@ rs6000_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
} }
/* Ignore terminated detached child processes. */ /* Ignore terminated detached child processes. */
if (!WIFSTOPPED (status) && pid != ptid_get_pid (inferior_ptid)) if (!WIFSTOPPED (status) && pid != inferior_ptid.pid ())
pid = -1; pid = -1;
} }
while (pid == -1); while (pid == -1);
@ -611,7 +611,7 @@ rs6000_nat_target::create_inferior (const char *exec_file,
static gdb::byte_vector static gdb::byte_vector
rs6000_ptrace_ldinfo (ptid_t ptid) rs6000_ptrace_ldinfo (ptid_t ptid)
{ {
const int pid = ptid_get_pid (ptid); const int pid = ptid.pid ();
gdb::byte_vector ldi (1024); gdb::byte_vector ldi (1024);
int rc = -1; int rc = -1;

View File

@ -260,7 +260,7 @@ s390_inferior_tid (void)
/* GNU/Linux LWP ID's are process ID's. */ /* GNU/Linux LWP ID's are process ID's. */
int tid = ptid_get_lwp (inferior_ptid); int tid = ptid_get_lwp (inferior_ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (inferior_ptid); /* Not a threaded program. */ tid = inferior_ptid.pid (); /* Not a threaded program. */
return tid; return tid;
} }
@ -622,7 +622,7 @@ s390_linux_nat_target::low_new_fork (struct lwp_info *parent, pid_t child_pid)
/* GDB core assumes the child inherits the watchpoints/hw breakpoints of /* GDB core assumes the child inherits the watchpoints/hw breakpoints of
the parent. So copy the debug state from parent to child. */ the parent. So copy the debug state from parent to child. */
parent_pid = ptid_get_pid (parent->ptid); parent_pid = parent->ptid.pid ();
parent_state = s390_get_debug_reg_state (parent_pid); parent_state = s390_get_debug_reg_state (parent_pid);
child_state = s390_get_debug_reg_state (child_pid); child_state = s390_get_debug_reg_state (child_pid);
@ -667,7 +667,7 @@ bool
s390_linux_nat_target::stopped_by_watchpoint () s390_linux_nat_target::stopped_by_watchpoint ()
{ {
struct s390_debug_reg_state *state struct s390_debug_reg_state *state
= s390_get_debug_reg_state (ptid_get_pid (inferior_ptid)); = s390_get_debug_reg_state (inferior_ptid.pid ());
per_lowcore_bits per_lowcore; per_lowcore_bits per_lowcore;
ptrace_area parea; ptrace_area parea;
@ -704,7 +704,7 @@ void
s390_linux_nat_target::low_prepare_to_resume (struct lwp_info *lp) s390_linux_nat_target::low_prepare_to_resume (struct lwp_info *lp)
{ {
int tid; int tid;
pid_t pid = ptid_get_pid (ptid_of_lwp (lp)); pid_t pid = ptid_of_lwp (lp).pid ();
per_struct per_info; per_struct per_info;
ptrace_area parea; ptrace_area parea;
@ -848,7 +848,7 @@ s390_refresh_per_info_cb (struct lwp_info *lp, void *arg)
static int static int
s390_refresh_per_info (void) s390_refresh_per_info (void)
{ {
ptid_t pid_ptid = ptid_t (ptid_get_pid (current_lwp_ptid ())); ptid_t pid_ptid = ptid_t (current_lwp_ptid ().pid ());
iterate_over_lwps (pid_ptid, s390_refresh_per_info_cb, NULL); iterate_over_lwps (pid_ptid, s390_refresh_per_info_cb, NULL);
return 0; return 0;
@ -861,7 +861,7 @@ s390_linux_nat_target::insert_watchpoint (CORE_ADDR addr, int len,
{ {
s390_watch_area area; s390_watch_area area;
struct s390_debug_reg_state *state struct s390_debug_reg_state *state
= s390_get_debug_reg_state (ptid_get_pid (inferior_ptid)); = s390_get_debug_reg_state (inferior_ptid.pid ());
area.lo_addr = addr; area.lo_addr = addr;
area.hi_addr = addr + len - 1; area.hi_addr = addr + len - 1;
@ -878,7 +878,7 @@ s390_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len,
unsigned ix; unsigned ix;
s390_watch_area *area; s390_watch_area *area;
struct s390_debug_reg_state *state struct s390_debug_reg_state *state
= s390_get_debug_reg_state (ptid_get_pid (inferior_ptid)); = s390_get_debug_reg_state (inferior_ptid.pid ());
for (ix = 0; for (ix = 0;
VEC_iterate (s390_watch_area, state->watch_areas, ix, area); VEC_iterate (s390_watch_area, state->watch_areas, ix, area);
@ -918,7 +918,7 @@ s390_linux_nat_target::insert_hw_breakpoint (struct gdbarch *gdbarch,
area.lo_addr = bp_tgt->placed_address = bp_tgt->reqstd_address; area.lo_addr = bp_tgt->placed_address = bp_tgt->reqstd_address;
area.hi_addr = area.lo_addr; area.hi_addr = area.lo_addr;
state = s390_get_debug_reg_state (ptid_get_pid (inferior_ptid)); state = s390_get_debug_reg_state (inferior_ptid.pid ());
VEC_safe_push (s390_watch_area, state->break_areas, &area); VEC_safe_push (s390_watch_area, state->break_areas, &area);
return s390_refresh_per_info (); return s390_refresh_per_info ();
@ -934,7 +934,7 @@ s390_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch,
struct watch_area *area; struct watch_area *area;
struct s390_debug_reg_state *state; struct s390_debug_reg_state *state;
state = s390_get_debug_reg_state (ptid_get_pid (inferior_ptid)); state = s390_get_debug_reg_state (inferior_ptid.pid ());
for (ix = 0; for (ix = 0;
VEC_iterate (s390_watch_area, state->break_areas, ix, area); VEC_iterate (s390_watch_area, state->break_areas, ix, area);
ix++) ix++)

View File

@ -51,7 +51,7 @@ static sh_nbsd_nat_target the_sh_nbsd_nat_target;
void void
sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno) sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{ {
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno)) if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno))
{ {
@ -73,7 +73,7 @@ sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
void void
sh_nbsd_nat_target::store_registers (struct regcache *regcache, int regno) sh_nbsd_nat_target::store_registers (struct regcache *regcache, int regno)
{ {
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno)) if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno))
{ {

View File

@ -325,7 +325,7 @@ thread_to_lwp (ptid_t thread_id, int default_lwp)
td_state_string (ti.ti_state)); td_state_string (ti.ti_state));
} }
return ptid_t (ptid_get_pid (thread_id), ti.ti_lid, 0); return ptid_t (thread_id.pid (), ti.ti_lid, 0);
} }
/* Convert an LWP ID into a POSIX or Solaris thread ID. If LWP_ID /* Convert an LWP ID into a POSIX or Solaris thread ID. If LWP_ID
@ -366,7 +366,7 @@ lwp_to_thread (ptid_t lwp)
else if (val != TD_OK) else if (val != TD_OK)
error (_("lwp_to_thread: td_thr_get_info: %s."), td_err_string (val)); error (_("lwp_to_thread: td_thr_get_info: %s."), td_err_string (val));
return ptid_t (ptid_get_pid (lwp), 0 , ti.ti_tid); return ptid_t (lwp.pid (), 0 , ti.ti_tid);
} }
@ -387,7 +387,7 @@ sol_thread_target::detach (inferior *inf, int from_tty)
target_ops *beneath = this->beneath (); target_ops *beneath = this->beneath ();
sol_thread_active = 0; sol_thread_active = 0;
inferior_ptid = ptid_t (ptid_get_pid (main_ph.ptid)); inferior_ptid = ptid_t (main_ph.ptid.pid ());
unpush_target (this); unpush_target (this);
beneath->detach (inf, from_tty); beneath->detach (inf, from_tty);
} }
@ -402,18 +402,18 @@ sol_thread_target::resume (ptid_t ptid, int step, enum gdb_signal signo)
{ {
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid); scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
inferior_ptid = thread_to_lwp (inferior_ptid, ptid_get_pid (main_ph.ptid)); inferior_ptid = thread_to_lwp (inferior_ptid, main_ph.ptid.pid ());
if (ptid_get_pid (inferior_ptid) == -1) if (inferior_ptid.pid () == -1)
inferior_ptid = procfs_first_available (); inferior_ptid = procfs_first_available ();
if (ptid_get_pid (ptid) != -1) if (ptid.pid () != -1)
{ {
ptid_t save_ptid = ptid; ptid_t save_ptid = ptid;
ptid = thread_to_lwp (ptid, -2); ptid = thread_to_lwp (ptid, -2);
if (ptid_get_pid (ptid) == -2) /* Inactive thread. */ if (ptid.pid () == -2) /* Inactive thread. */
error (_("This version of Solaris can't start inactive threads.")); error (_("This version of Solaris can't start inactive threads."));
if (info_verbose && ptid_get_pid (ptid) == -1) if (info_verbose && ptid.pid () == -1)
warning (_("Specified thread %ld seems to have terminated"), warning (_("Specified thread %ld seems to have terminated"),
ptid_get_tid (save_ptid)); ptid_get_tid (save_ptid));
} }
@ -434,18 +434,18 @@ sol_thread_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
save_ptid = inferior_ptid; save_ptid = inferior_ptid;
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid); scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
inferior_ptid = thread_to_lwp (inferior_ptid, ptid_get_pid (main_ph.ptid)); inferior_ptid = thread_to_lwp (inferior_ptid, main_ph.ptid.pid ());
if (ptid_get_pid (inferior_ptid) == -1) if (inferior_ptid.pid () == -1)
inferior_ptid = procfs_first_available (); inferior_ptid = procfs_first_available ();
if (ptid_get_pid (ptid) != -1) if (ptid.pid () != -1)
{ {
ptid_t save_ptid = ptid; ptid_t save_ptid = ptid;
ptid = thread_to_lwp (ptid, -2); ptid = thread_to_lwp (ptid, -2);
if (ptid_get_pid (ptid) == -2) /* Inactive thread. */ if (ptid.pid () == -2) /* Inactive thread. */
error (_("This version of Solaris can't start inactive threads.")); error (_("This version of Solaris can't start inactive threads."));
if (info_verbose && ptid_get_pid (ptid) == -1) if (info_verbose && ptid.pid () == -1)
warning (_("Specified thread %ld seems to have terminated"), warning (_("Specified thread %ld seems to have terminated"),
ptid_get_tid (save_ptid)); ptid_get_tid (save_ptid));
} }
@ -456,7 +456,7 @@ sol_thread_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
{ {
/* Map the LWP of interest back to the appropriate thread ID. */ /* Map the LWP of interest back to the appropriate thread ID. */
rtnval = lwp_to_thread (rtnval); rtnval = lwp_to_thread (rtnval);
if (ptid_get_pid (rtnval) == -1) if (rtnval.pid () == -1)
rtnval = save_ptid; rtnval = save_ptid;
/* See if we have a new thread. */ /* See if we have a new thread. */
@ -652,7 +652,7 @@ check_for_thread_db (void)
main_ph.ptid = inferior_ptid; /* Save for xfer_memory. */ main_ph.ptid = inferior_ptid; /* Save for xfer_memory. */
ptid = lwp_to_thread (inferior_ptid); ptid = lwp_to_thread (inferior_ptid);
if (ptid_get_pid (ptid) != -1) if (ptid.pid () != -1)
inferior_ptid = ptid; inferior_ptid = ptid;
target_update_thread_list (); target_update_thread_list ();
@ -849,7 +849,7 @@ ps_ptwrite (struct ps_prochandle *ph, psaddr_t addr,
ps_err_e ps_err_e
ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset) ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset)
{ {
ptid_t ptid = ptid_t (ptid_get_pid (inferior_ptid), lwpid, 0); ptid_t ptid = ptid_t (inferior_ptid.pid (), lwpid, 0);
struct regcache *regcache struct regcache *regcache
= get_thread_arch_regcache (ptid, target_gdbarch ()); = get_thread_arch_regcache (ptid, target_gdbarch ());
@ -865,7 +865,7 @@ ps_err_e
ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid, ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid,
const prgregset_t gregset) const prgregset_t gregset)
{ {
ptid_t ptid = ptid_t (ptid_get_pid (inferior_ptid), lwpid, 0); ptid_t ptid = ptid_t (inferior_ptid.pid (), lwpid, 0);
struct regcache *regcache struct regcache *regcache
= get_thread_arch_regcache (ptid, target_gdbarch ()); = get_thread_arch_regcache (ptid, target_gdbarch ());
@ -917,7 +917,7 @@ ps_err_e
ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid,
prfpregset_t *fpregset) prfpregset_t *fpregset)
{ {
ptid_t ptid = ptid_t (ptid_get_pid (inferior_ptid), lwpid, 0); ptid_t ptid = ptid_t (inferior_ptid.pid (), lwpid, 0);
struct regcache *regcache struct regcache *regcache
= get_thread_arch_regcache (ptid, target_gdbarch ()); = get_thread_arch_regcache (ptid, target_gdbarch ());
@ -933,7 +933,7 @@ ps_err_e
ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid,
const prfpregset_t * fpregset) const prfpregset_t * fpregset)
{ {
ptid_t ptid = ptid_t (ptid_get_pid (inferior_ptid), lwpid, 0); ptid_t ptid = ptid_t (inferior_ptid.pid (), lwpid, 0);
struct regcache *regcache struct regcache *regcache
= get_thread_arch_regcache (ptid, target_gdbarch ()); = get_thread_arch_regcache (ptid, target_gdbarch ());
@ -979,10 +979,10 @@ ps_lgetLDT (struct ps_prochandle *ph, lwpid_t lwpid,
/* FIXME: can't I get the process ID from the prochandle or /* FIXME: can't I get the process ID from the prochandle or
something? */ something? */
if (ptid_get_pid (inferior_ptid) <= 0 || lwpid <= 0) if (inferior_ptid.pid () <= 0 || lwpid <= 0)
return PS_BADLID; return PS_BADLID;
ret = procfs_find_LDT_entry (ptid_t (ptid_get_pid (inferior_ptid), ret = procfs_find_LDT_entry (ptid_t (inferior_ptid.pid (),
lwpid, 0)); lwpid, 0));
if (ret) if (ret)
{ {
@ -1009,10 +1009,10 @@ sol_thread_target::pid_to_str (ptid_t ptid)
lwp = thread_to_lwp (ptid, -2); lwp = thread_to_lwp (ptid, -2);
if (ptid_get_pid (lwp) == -1) if (lwp.pid () == -1)
xsnprintf (buf, sizeof (buf), "Thread %ld (defunct)", xsnprintf (buf, sizeof (buf), "Thread %ld (defunct)",
ptid_get_tid (ptid)); ptid_get_tid (ptid));
else if (ptid_get_pid (lwp) != -2) else if (lwp.pid () != -2)
xsnprintf (buf, sizeof (buf), "Thread %ld (LWP %ld)", xsnprintf (buf, sizeof (buf), "Thread %ld (LWP %ld)",
ptid_get_tid (ptid), ptid_get_lwp (lwp)); ptid_get_tid (ptid), ptid_get_lwp (lwp));
else else
@ -1022,7 +1022,7 @@ sol_thread_target::pid_to_str (ptid_t ptid)
else if (ptid_get_lwp (ptid) != 0) else if (ptid_get_lwp (ptid) != 0)
xsnprintf (buf, sizeof (buf), "LWP %ld ", ptid_get_lwp (ptid)); xsnprintf (buf, sizeof (buf), "LWP %ld ", ptid_get_lwp (ptid));
else else
xsnprintf (buf, sizeof (buf), "process %d ", ptid_get_pid (ptid)); xsnprintf (buf, sizeof (buf), "process %d ", ptid.pid ());
return buf; return buf;
} }
@ -1042,7 +1042,7 @@ sol_update_thread_list_callback (const td_thrhandle_t *th, void *ignored)
if (retval != TD_OK) if (retval != TD_OK)
return -1; return -1;
ptid = ptid_t (ptid_get_pid (inferior_ptid), 0, ti.ti_tid); ptid = ptid_t (inferior_ptid.pid (), 0, ti.ti_tid);
if (!in_thread_list (ptid) || is_exited (ptid)) if (!in_thread_list (ptid) || is_exited (ptid))
add_thread (ptid); add_thread (ptid);

View File

@ -274,7 +274,7 @@ sparc_xfer_wcookie (struct target_ops *ops, enum target_object object,
later). Since release 3.6, OpenBSD uses a fully randomized later). Since release 3.6, OpenBSD uses a fully randomized
cookie. */ cookie. */
{ {
int pid = ptid_get_pid (inferior_ptid); int pid = inferior_ptid.pid ();
/* Sanity check. The proper type for a cookie is register_t, but /* Sanity check. The proper type for a cookie is register_t, but
we can't assume that this type exists on all systems supported we can't assume that this type exists on all systems supported

View File

@ -214,7 +214,7 @@ read_maps_entry (const char *line,
static bool static bool
adi_available (void) adi_available (void)
{ {
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
sparc64_adi_info *proc = get_adi_info_proc (pid); sparc64_adi_info *proc = get_adi_info_proc (pid);
CORE_ADDR value; CORE_ADDR value;
@ -238,7 +238,7 @@ adi_available (void)
static CORE_ADDR static CORE_ADDR
adi_normalize_address (CORE_ADDR addr) adi_normalize_address (CORE_ADDR addr)
{ {
adi_stat_t ast = get_adi_info (ptid_get_pid (inferior_ptid)); adi_stat_t ast = get_adi_info (inferior_ptid.pid ());
if (ast.nbits) if (ast.nbits)
{ {
@ -258,7 +258,7 @@ adi_normalize_address (CORE_ADDR addr)
static CORE_ADDR static CORE_ADDR
adi_align_address (CORE_ADDR naddr) adi_align_address (CORE_ADDR naddr)
{ {
adi_stat_t ast = get_adi_info (ptid_get_pid (inferior_ptid)); adi_stat_t ast = get_adi_info (inferior_ptid.pid ());
return (naddr - (naddr % ast.blksize)) / ast.blksize; return (naddr - (naddr % ast.blksize)) / ast.blksize;
} }
@ -268,7 +268,7 @@ adi_align_address (CORE_ADDR naddr)
static int static int
adi_convert_byte_count (CORE_ADDR naddr, int nbytes, CORE_ADDR locl) adi_convert_byte_count (CORE_ADDR naddr, int nbytes, CORE_ADDR locl)
{ {
adi_stat_t ast = get_adi_info (ptid_get_pid (inferior_ptid)); adi_stat_t ast = get_adi_info (inferior_ptid.pid ());
return ((naddr + nbytes + ast.blksize - 1) / ast.blksize) - locl; return ((naddr + nbytes + ast.blksize - 1) / ast.blksize) - locl;
} }
@ -285,7 +285,7 @@ adi_convert_byte_count (CORE_ADDR naddr, int nbytes, CORE_ADDR locl)
static int static int
adi_tag_fd (void) adi_tag_fd (void)
{ {
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
sparc64_adi_info *proc = get_adi_info_proc (pid); sparc64_adi_info *proc = get_adi_info_proc (pid);
if (proc->stat.tag_fd != 0) if (proc->stat.tag_fd != 0)
@ -309,7 +309,7 @@ adi_is_addr_mapped (CORE_ADDR vaddr, size_t cnt)
char filename[MAX_PROC_NAME_SIZE]; char filename[MAX_PROC_NAME_SIZE];
size_t i = 0; size_t i = 0;
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
snprintf (filename, sizeof filename, "/proc/%ld/adi/maps", (long) pid); snprintf (filename, sizeof filename, "/proc/%ld/adi/maps", (long) pid);
gdb::unique_xmalloc_ptr<char> data gdb::unique_xmalloc_ptr<char> data
= target_fileio_read_stralloc (NULL, filename); = target_fileio_read_stralloc (NULL, filename);
@ -349,7 +349,7 @@ adi_read_versions (CORE_ADDR vaddr, size_t size, gdb_byte *tags)
if (!adi_is_addr_mapped (vaddr, size)) if (!adi_is_addr_mapped (vaddr, size))
{ {
adi_stat_t ast = get_adi_info (ptid_get_pid (inferior_ptid)); adi_stat_t ast = get_adi_info (inferior_ptid.pid ());
error(_("Address at %s is not in ADI maps"), error(_("Address at %s is not in ADI maps"),
paddress (target_gdbarch (), vaddr * ast.blksize)); paddress (target_gdbarch (), vaddr * ast.blksize));
} }
@ -370,7 +370,7 @@ adi_write_versions (CORE_ADDR vaddr, size_t size, unsigned char *tags)
if (!adi_is_addr_mapped (vaddr, size)) if (!adi_is_addr_mapped (vaddr, size))
{ {
adi_stat_t ast = get_adi_info (ptid_get_pid (inferior_ptid)); adi_stat_t ast = get_adi_info (inferior_ptid.pid ());
error(_("Address at %s is not in ADI maps"), error(_("Address at %s is not in ADI maps"),
paddress (target_gdbarch (), vaddr * ast.blksize)); paddress (target_gdbarch (), vaddr * ast.blksize));
} }
@ -388,7 +388,7 @@ adi_print_versions (CORE_ADDR vaddr, size_t cnt, gdb_byte *tags)
int v_idx = 0; int v_idx = 0;
const int maxelts = 8; /* # of elements per line */ const int maxelts = 8; /* # of elements per line */
adi_stat_t adi_stat = get_adi_info (ptid_get_pid (inferior_ptid)); adi_stat_t adi_stat = get_adi_info (inferior_ptid.pid ());
while (cnt > 0) while (cnt > 0)
{ {
@ -461,7 +461,7 @@ adi_examine_command (const char *args, int from_tty)
if (!adi_available ()) if (!adi_available ())
error (_("No ADI information")); error (_("No ADI information"));
pid_t pid = ptid_get_pid (inferior_ptid); pid_t pid = inferior_ptid.pid ();
sparc64_adi_info *proc = get_adi_info_proc (pid); sparc64_adi_info *proc = get_adi_info_proc (pid);
int cnt = 1; int cnt = 1;
const char *p = args; const char *p = args;
@ -523,7 +523,7 @@ adi_assign_command (const char *args, int from_tty)
int version = 0; int version = 0;
if (q != NULL) /* parse version tag */ if (q != NULL) /* parse version tag */
{ {
adi_stat_t ast = get_adi_info (ptid_get_pid (inferior_ptid)); adi_stat_t ast = get_adi_info (inferior_ptid.pid ());
version = parse_and_eval_long (q); version = parse_and_eval_long (q);
if (version < 0 || version > ast.max_version) if (version < 0 || version > ast.max_version)
error (_("Invalid ADI version tag %d"), version); error (_("Invalid ADI version tag %d"), version);

View File

@ -71,7 +71,7 @@ fetch_ppc_register (int regno)
int tid = ptid_get_lwp (inferior_ptid); int tid = ptid_get_lwp (inferior_ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (inferior_ptid); tid = inferior_ptid.pid ();
#ifndef __powerpc64__ #ifndef __powerpc64__
/* If running as a 32-bit process on a 64-bit system, we attempt /* If running as a 32-bit process on a 64-bit system, we attempt
@ -156,7 +156,7 @@ fetch_ppc_memory (ULONGEST memaddr, gdb_byte *myaddr, int len)
int tid = ptid_get_lwp (inferior_ptid); int tid = ptid_get_lwp (inferior_ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (inferior_ptid); tid = inferior_ptid.pid ();
buffer = (PTRACE_TYPE_RET *) alloca (count * sizeof (PTRACE_TYPE_RET)); buffer = (PTRACE_TYPE_RET *) alloca (count * sizeof (PTRACE_TYPE_RET));
for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET)) for (i = 0; i < count; i++, addr += sizeof (PTRACE_TYPE_RET))
@ -186,7 +186,7 @@ store_ppc_memory (ULONGEST memaddr, const gdb_byte *myaddr, int len)
int tid = ptid_get_lwp (inferior_ptid); int tid = ptid_get_lwp (inferior_ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (inferior_ptid); tid = inferior_ptid.pid ();
buffer = (PTRACE_TYPE_RET *) alloca (count * sizeof (PTRACE_TYPE_RET)); buffer = (PTRACE_TYPE_RET *) alloca (count * sizeof (PTRACE_TYPE_RET));
@ -259,7 +259,7 @@ spu_proc_xfer_spu (const char *annex, gdb_byte *readbuf,
char buf[128]; char buf[128];
int fd = 0; int fd = 0;
int ret = -1; int ret = -1;
int pid = ptid_get_pid (inferior_ptid); int pid = inferior_ptid.pid ();
if (!annex) if (!annex)
return TARGET_XFER_EOF; return TARGET_XFER_EOF;
@ -424,7 +424,7 @@ spu_linux_nat_target::post_startup_inferior (ptid_t ptid)
int tid = ptid_get_lwp (ptid); int tid = ptid_get_lwp (ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (ptid); tid = ptid.pid ();
while (!parse_spufs_run (&fd, &addr)) while (!parse_spufs_run (&fd, &addr))
{ {
@ -471,17 +471,17 @@ spu_linux_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
set_sigint_trap (); /* Causes SIGINT to be passed on to the set_sigint_trap (); /* Causes SIGINT to be passed on to the
attached process. */ attached process. */
pid = waitpid (ptid_get_pid (ptid), &status, 0); pid = waitpid (ptid.pid (), &status, 0);
if (pid == -1 && errno == ECHILD) if (pid == -1 && errno == ECHILD)
/* Try again with __WCLONE to check cloned processes. */ /* Try again with __WCLONE to check cloned processes. */
pid = waitpid (ptid_get_pid (ptid), &status, __WCLONE); pid = waitpid (ptid.pid (), &status, __WCLONE);
save_errno = errno; save_errno = errno;
/* Make sure we don't report an event for the exit of the /* Make sure we don't report an event for the exit of the
original program, if we've detached from it. */ original program, if we've detached from it. */
if (pid != -1 && !WIFSTOPPED (status) if (pid != -1 && !WIFSTOPPED (status)
&& pid != ptid_get_pid (inferior_ptid)) && pid != inferior_ptid.pid ())
{ {
pid = -1; pid = -1;
save_errno = EINTR; save_errno = EINTR;

View File

@ -1596,14 +1596,14 @@ spu_memory_remove_breakpoint (struct gdbarch *gdbarch,
-- this is not the correct behaviour. -- this is not the correct behaviour.
The workaround is to check whether the PID we are asked to remove this The workaround is to check whether the PID we are asked to remove this
breakpoint from (i.e. ptid_get_pid (inferior_ptid)) is different from the breakpoint from (i.e. inferior_ptid.pid ()) is different from the
PID of the current inferior (i.e. current_inferior ()->pid). This is only PID of the current inferior (i.e. current_inferior ()->pid). This is only
true in the context of detach_breakpoints. If so, we simply do nothing. true in the context of detach_breakpoints. If so, we simply do nothing.
[ Note that for the fork child process, it does not matter if breakpoints [ Note that for the fork child process, it does not matter if breakpoints
remain inserted, because those SPU contexts are not runnable anyway -- remain inserted, because those SPU contexts are not runnable anyway --
the Linux kernel allows only the original process to invoke spu_run. */ the Linux kernel allows only the original process to invoke spu_run. */
if (ptid_get_pid (inferior_ptid) != current_inferior ()->pid) if (inferior_ptid.pid () != current_inferior ()->pid)
return 0; return 0;
return default_memory_remove_breakpoint (gdbarch, bp_tgt); return default_memory_remove_breakpoint (gdbarch, bp_tgt);

View File

@ -71,7 +71,7 @@
#define target_debug_print_enum_btrace_error(X) \ #define target_debug_print_enum_btrace_error(X) \
target_debug_do_print (plongest (X)) target_debug_do_print (plongest (X))
#define target_debug_print_ptid_t(X) \ #define target_debug_print_ptid_t(X) \
target_debug_do_print (plongest (ptid_get_pid (X))) target_debug_do_print (plongest (X.pid ()))
#define target_debug_print_struct_gdbarch_p(X) \ #define target_debug_print_struct_gdbarch_p(X) \
target_debug_do_print (gdbarch_bfd_arch_info (X)->printable_name) target_debug_do_print (gdbarch_bfd_arch_info (X)->printable_name)
#define target_debug_print_const_gdb_byte_p(X) \ #define target_debug_print_const_gdb_byte_p(X) \

View File

@ -618,7 +618,7 @@ default_terminal_info (struct target_ops *self, const char *args, int from_tty)
static ptid_t static ptid_t
default_get_ada_task_ptid (struct target_ops *self, long lwp, long tid) default_get_ada_task_ptid (struct target_ops *self, long lwp, long tid)
{ {
return ptid_t (ptid_get_pid (inferior_ptid), lwp, tid); return ptid_t (inferior_ptid.pid (), lwp, tid);
} }
static enum exec_direction_kind static enum exec_direction_kind
@ -3240,7 +3240,7 @@ target_announce_detach (int from_tty)
if (exec_file == NULL) if (exec_file == NULL)
exec_file = ""; exec_file = "";
pid = ptid_get_pid (inferior_ptid); pid = inferior_ptid.pid ();
printf_unfiltered (_("Detaching from program: %s, %s\n"), exec_file, printf_unfiltered (_("Detaching from program: %s, %s\n"), exec_file,
target_pid_to_str (ptid_t (pid))); target_pid_to_str (ptid_t (pid)));
gdb_flush (gdb_stdout); gdb_flush (gdb_stdout);
@ -3285,7 +3285,7 @@ normal_pid_to_str (ptid_t ptid)
{ {
static char buf[32]; static char buf[32];
xsnprintf (buf, sizeof buf, "process %d", ptid_get_pid (ptid)); xsnprintf (buf, sizeof buf, "process %d", ptid.pid ());
return buf; return buf;
} }

View File

@ -783,7 +783,7 @@ thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid)
changes. E.g, target remote may only discover the remote process changes. E.g, target remote may only discover the remote process
pid after adding the inferior to GDB's list. */ pid after adding the inferior to GDB's list. */
inf = find_inferior_ptid (old_ptid); inf = find_inferior_ptid (old_ptid);
inf->pid = ptid_get_pid (new_ptid); inf->pid = new_ptid.pid ();
tp = find_thread_ptid (old_ptid); tp = find_thread_ptid (old_ptid);
tp->ptid = new_ptid; tp->ptid = new_ptid;
@ -802,7 +802,7 @@ set_resumed (ptid_t ptid, int resumed)
if (all || ptid_is_pid (ptid)) if (all || ptid_is_pid (ptid))
{ {
for (tp = thread_list; tp; tp = tp->next) for (tp = thread_list; tp; tp = tp->next)
if (all || ptid_get_pid (tp->ptid) == ptid_get_pid (ptid)) if (all || tp->ptid.pid () == ptid.pid ())
tp->resumed = resumed; tp->resumed = resumed;
} }
else else
@ -859,7 +859,7 @@ set_running (ptid_t ptid, int running)
if (all || ptid_is_pid (ptid)) if (all || ptid_is_pid (ptid))
{ {
for (tp = thread_list; tp; tp = tp->next) for (tp = thread_list; tp; tp = tp->next)
if (all || ptid_get_pid (tp->ptid) == ptid_get_pid (ptid)) if (all || tp->ptid.pid () == ptid.pid ())
{ {
if (tp->state == THREAD_EXITED) if (tp->state == THREAD_EXITED)
continue; continue;
@ -939,7 +939,7 @@ set_executing (ptid_t ptid, int executing)
if (all || ptid_is_pid (ptid)) if (all || ptid_is_pid (ptid))
{ {
for (tp = thread_list; tp; tp = tp->next) for (tp = thread_list; tp; tp = tp->next)
if (all || ptid_get_pid (tp->ptid) == ptid_get_pid (ptid)) if (all || tp->ptid.pid () == ptid.pid ())
set_executing_thread (tp, executing); set_executing_thread (tp, executing);
} }
else else
@ -975,7 +975,7 @@ set_stop_requested (ptid_t ptid, int stop)
if (all || ptid_is_pid (ptid)) if (all || ptid_is_pid (ptid))
{ {
for (tp = thread_list; tp; tp = tp->next) for (tp = thread_list; tp; tp = tp->next)
if (all || ptid_get_pid (tp->ptid) == ptid_get_pid (ptid)) if (all || tp->ptid.pid () == ptid.pid ())
tp->stop_requested = stop; tp->stop_requested = stop;
} }
else else
@ -1006,7 +1006,7 @@ finish_thread_state (ptid_t ptid)
{ {
if (tp->state == THREAD_EXITED) if (tp->state == THREAD_EXITED)
continue; continue;
if (all || ptid_get_pid (ptid) == ptid_get_pid (tp->ptid)) if (all || ptid.pid () == tp->ptid.pid ())
{ {
if (set_running_thread (tp, tp->executing)) if (set_running_thread (tp, tp->executing))
any_started = 1; any_started = 1;
@ -1106,7 +1106,7 @@ should_print_thread (const char *requested_threads, int default_inf_num,
return 0; return 0;
} }
if (pid != -1 && ptid_get_pid (thr->ptid) != pid) if (pid != -1 && thr->ptid.pid () != pid)
{ {
if (requested_threads != NULL && *requested_threads != '\0') if (requested_threads != NULL && *requested_threads != '\0')
error (_("Requested thread not found in requested process")); error (_("Requested thread not found in requested process"));

View File

@ -92,7 +92,7 @@ parse_thread_id (const char *tidstr, const char **end)
ALL_THREADS (tp) ALL_THREADS (tp)
{ {
if (ptid_get_pid (tp->ptid) == inf->pid if (tp->ptid.pid () == inf->pid
&& tp->per_inf_num == thr_num) && tp->per_inf_num == thr_num)
break; break;
} }

View File

@ -74,7 +74,7 @@ void
vax_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum) vax_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{ {
struct reg regs; struct reg regs;
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1) if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers")); perror_with_name (_("Couldn't get registers"));
@ -89,7 +89,7 @@ void
vax_bsd_nat_target::store_registers (struct regcache *regcache, int regnum) vax_bsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{ {
struct reg regs; struct reg regs;
pid_t pid = ptid_get_pid (regcache->ptid ()); pid_t pid = regcache->ptid ().pid ();
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1) if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) &regs, 0) == -1)
perror_with_name (_("Couldn't get registers")); perror_with_name (_("Couldn't get registers"));

View File

@ -1429,7 +1429,7 @@ windows_nat_target::resume (ptid_t ptid, int step, enum gdb_signal sig)
last_sig = GDB_SIGNAL_0; last_sig = GDB_SIGNAL_0;
DEBUG_EXEC (("gdb: windows_resume (pid=%d, tid=%ld, step=%d, sig=%d);\n", DEBUG_EXEC (("gdb: windows_resume (pid=%d, tid=%ld, step=%d, sig=%d);\n",
ptid_get_pid (ptid), ptid_get_tid (ptid), step, sig)); ptid.pid (), ptid_get_tid (ptid), step, sig));
/* Get context for currently selected thread. */ /* Get context for currently selected thread. */
th = thread_rec (ptid_get_tid (inferior_ptid), FALSE); th = thread_rec (ptid_get_tid (inferior_ptid), FALSE);
@ -2908,7 +2908,7 @@ void
windows_nat_target::close () windows_nat_target::close ()
{ {
DEBUG_EVENTS (("gdb: windows_close, inferior_ptid=%d\n", DEBUG_EVENTS (("gdb: windows_close, inferior_ptid=%d\n",
ptid_get_pid (inferior_ptid))); inferior_ptid.pid ()));
} }
/* Convert pid to printable format. */ /* Convert pid to printable format. */
@ -2920,7 +2920,7 @@ windows_nat_target::pid_to_str (ptid_t ptid)
if (ptid_get_tid (ptid) != 0) if (ptid_get_tid (ptid) != 0)
{ {
snprintf (buf, sizeof (buf), "Thread %d.0x%lx", snprintf (buf, sizeof (buf), "Thread %d.0x%lx",
ptid_get_pid (ptid), ptid_get_tid (ptid)); ptid.pid (), ptid_get_tid (ptid));
return buf; return buf;
} }
@ -3020,7 +3020,7 @@ windows_nat_target::get_tib_address (ptid_t ptid, CORE_ADDR *addr)
ptid_t ptid_t
windows_nat_target::get_ada_task_ptid (long lwp, long thread) windows_nat_target::get_ada_task_ptid (long lwp, long thread)
{ {
return ptid_t (ptid_get_pid (inferior_ptid), 0, lwp); return ptid_t (inferior_ptid.pid (), 0, lwp);
} }
/* Implementation of the to_thread_name method. */ /* Implementation of the to_thread_name method. */

View File

@ -70,7 +70,7 @@ x86_linux_nat_target::low_new_fork (struct lwp_info *parent, pid_t child_pid)
in the end before detaching the forked off process, thus making in the end before detaching the forked off process, thus making
this compatible with older Linux kernels too. */ this compatible with older Linux kernels too. */
parent_pid = ptid_get_pid (parent->ptid); parent_pid = parent->ptid.pid ();
parent_state = x86_debug_reg_state (parent_pid); parent_state = x86_debug_reg_state (parent_pid);
child_state = x86_debug_reg_state (child_pid); child_state = x86_debug_reg_state (child_pid);
*child_state = *parent_state; *child_state = *parent_state;
@ -116,7 +116,7 @@ x86_linux_nat_target::read_description ()
/* GNU/Linux LWP ID's are process ID's. */ /* GNU/Linux LWP ID's are process ID's. */
tid = ptid_get_lwp (inferior_ptid); tid = ptid_get_lwp (inferior_ptid);
if (tid == 0) if (tid == 0)
tid = ptid_get_pid (inferior_ptid); /* Not a threaded program. */ tid = inferior_ptid.pid (); /* Not a threaded program. */
#ifdef __x86_64__ #ifdef __x86_64__
{ {

View File

@ -139,7 +139,7 @@ void
x86_cleanup_dregs (void) x86_cleanup_dregs (void)
{ {
/* Starting from scratch has the same effect. */ /* Starting from scratch has the same effect. */
x86_forget_process (ptid_get_pid (inferior_ptid)); x86_forget_process (inferior_ptid.pid ());
} }
/* Insert a watchpoint to watch a memory region which starts at /* Insert a watchpoint to watch a memory region which starts at
@ -151,7 +151,7 @@ x86_insert_watchpoint (CORE_ADDR addr, int len,
enum target_hw_bp_type type, struct expression *cond) enum target_hw_bp_type type, struct expression *cond)
{ {
struct x86_debug_reg_state *state struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (inferior_ptid)); = x86_debug_reg_state (inferior_ptid.pid ());
return x86_dr_insert_watchpoint (state, type, addr, len); return x86_dr_insert_watchpoint (state, type, addr, len);
} }
@ -164,7 +164,7 @@ x86_remove_watchpoint (CORE_ADDR addr, int len,
enum target_hw_bp_type type, struct expression *cond) enum target_hw_bp_type type, struct expression *cond)
{ {
struct x86_debug_reg_state *state struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (inferior_ptid)); = x86_debug_reg_state (inferior_ptid.pid ());
return x86_dr_remove_watchpoint (state, type, addr, len); return x86_dr_remove_watchpoint (state, type, addr, len);
} }
@ -176,7 +176,7 @@ int
x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) x86_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
{ {
struct x86_debug_reg_state *state struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (inferior_ptid)); = x86_debug_reg_state (inferior_ptid.pid ());
return x86_dr_region_ok_for_watchpoint (state, addr, len); return x86_dr_region_ok_for_watchpoint (state, addr, len);
} }
@ -189,7 +189,7 @@ int
x86_stopped_data_address (CORE_ADDR *addr_p) x86_stopped_data_address (CORE_ADDR *addr_p)
{ {
struct x86_debug_reg_state *state struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (inferior_ptid)); = x86_debug_reg_state (inferior_ptid.pid ());
return x86_dr_stopped_data_address (state, addr_p); return x86_dr_stopped_data_address (state, addr_p);
} }
@ -201,7 +201,7 @@ int
x86_stopped_by_watchpoint () x86_stopped_by_watchpoint ()
{ {
struct x86_debug_reg_state *state struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (inferior_ptid)); = x86_debug_reg_state (inferior_ptid.pid ());
return x86_dr_stopped_by_watchpoint (state); return x86_dr_stopped_by_watchpoint (state);
} }
@ -213,7 +213,7 @@ int
x86_insert_hw_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) x86_insert_hw_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
{ {
struct x86_debug_reg_state *state struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (inferior_ptid)); = x86_debug_reg_state (inferior_ptid.pid ());
bp_tgt->placed_address = bp_tgt->reqstd_address; bp_tgt->placed_address = bp_tgt->reqstd_address;
return x86_dr_insert_watchpoint (state, hw_execute, return x86_dr_insert_watchpoint (state, hw_execute,
@ -228,7 +228,7 @@ x86_remove_hw_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt) struct bp_target_info *bp_tgt)
{ {
struct x86_debug_reg_state *state struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (inferior_ptid)); = x86_debug_reg_state (inferior_ptid.pid ());
return x86_dr_remove_watchpoint (state, hw_execute, return x86_dr_remove_watchpoint (state, hw_execute,
bp_tgt->placed_address, 1); bp_tgt->placed_address, 1);
@ -264,7 +264,7 @@ int
x86_stopped_by_hw_breakpoint () x86_stopped_by_hw_breakpoint ()
{ {
struct x86_debug_reg_state *state struct x86_debug_reg_state *state
= x86_debug_reg_state (ptid_get_pid (inferior_ptid)); = x86_debug_reg_state (inferior_ptid.pid ());
return x86_dr_stopped_by_hw_breakpoint (state); return x86_dr_stopped_by_hw_breakpoint (state);
} }