diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2017-03-22 10:35:07 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-03-22 10:35:16 -0400 |
commit | b67aeab02c05fdd654f132a550dd4f196cb1f6d3 (patch) | |
tree | 70854307923a84c0a2877c5e0ec5cab47f4c091f /gas/config/tc-xtensa.c | |
parent | 11997a83a040245406b6e2e9978c6720f17e80c4 (diff) | |
download | gdb-b67aeab02c05fdd654f132a550dd4f196cb1f6d3.zip gdb-b67aeab02c05fdd654f132a550dd4f196cb1f6d3.tar.gz gdb-b67aeab02c05fdd654f132a550dd4f196cb1f6d3.tar.bz2 |
Remove lwp -> pid conversion in linux_nat_xfer_partial
The linux_nat_xfer_partial does a conversion of inferior_ptid: if it's
an LWP (ptid::lwp != 0), it builds a new ptid with the lwp as
the pid and assigns that temporarily to inferior_ptid. For example, if
inferior_ptid is:
{ .pid = 1234, .lwp = 1235 }
it will assign this to inferior_ptid for the duration of the call:
{ .pid = 1235, .lwp = 0 }
Instead of doing this, this patch teaches the inf-ptrace implementation
of xfer_partial to deal with ptids representing lwps by using
get_ptrace_pid.
Also, in linux_proc_xfer_spu and linux_proc_xfer_partial, we use ptid_get_lwp
instead of ptid_get_pid. While not strictly necessary, since the content of
/proc/<pid> and /proc/<lwp> should be the same, it's a bit safer, because:
- some files under /proc/<pid>/ may not work if the <pid> thread is
running, just like ptrace requires a stopped thread. The current
thread's lwp id is more likely to be in the necessary state (stopped).
- if the leader (<pid>) had exited and is thus now zombie, then several
files under "/proc/<pid>" won't work, while they will if you use
"/proc/<lwp>".
The testsuite found no regression on native amd64 linux.
gdb/ChangeLog:
* 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.
Diffstat (limited to 'gas/config/tc-xtensa.c')
0 files changed, 0 insertions, 0 deletions