+2017-03-22 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * inf-ptrace.c (inf_ptrace_xfer_partial): Get pid from ptid
+ using get_ptrace_pid.
+ * linux-nat.c (linux_nat_xfer_partial): Don't set/restore
+ inferior_ptid.
+ (linux_proc_xfer_partial, linux_proc_xfer_spu): Use lwp of
+ inferior_ptid instead of pid.
+
2017-03-22 Yao Qi <yao.qi@linaro.org>
* aarch64-tdep.c: Wrap locally used classes in anonymous
const gdb_byte *writebuf,
ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
{
- pid_t pid = ptid_get_pid (inferior_ptid);
+ pid_t pid = get_ptrace_pid (inferior_ptid);
switch (object)
{
const gdb_byte *writebuf,
ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
{
- struct cleanup *old_chain;
enum target_xfer_status xfer;
if (object == TARGET_OBJECT_SIGNAL_INFO)
if (object == TARGET_OBJECT_MEMORY && ptid_equal (inferior_ptid, null_ptid))
return TARGET_XFER_EOF;
- old_chain = save_inferior_ptid ();
-
- if (ptid_lwp_p (inferior_ptid))
- inferior_ptid = pid_to_ptid (ptid_get_lwp (inferior_ptid));
-
xfer = linux_ops->to_xfer_partial (ops, object, annex, readbuf, writebuf,
offset, len, xfered_len);
- do_cleanups (old_chain);
return xfer;
}
/* We could keep this file open and cache it - possibly one per
thread. That requires some juggling, but is even faster. */
- xsnprintf (filename, sizeof filename, "/proc/%d/mem",
- ptid_get_pid (inferior_ptid));
+ xsnprintf (filename, sizeof filename, "/proc/%ld/mem",
+ ptid_get_lwp (inferior_ptid));
fd = gdb_open_cloexec (filename, ((readbuf ? O_RDONLY : O_WRONLY)
| O_LARGEFILE), 0);
if (fd == -1)
char buf[128];
int fd = 0;
int ret = -1;
- int pid = ptid_get_pid (inferior_ptid);
+ int pid = ptid_get_lwp (inferior_ptid);
if (!annex)
{