On Tue, 2014-02-25 at 23:03 +0100, Mark Wielaard wrote:
On Sat, 2014-02-22 at 22:08 +0100, Jan Kratochvil wrote:
> This patchset (/dev/PID/mem solution) works only on recent Linux kernels
> (tested kernel-3.13.3-201.fc20.x86_64) as older kernels (RHEL-6) required
> PTRACE_ATTACHed PID to read its /dev/PID/mem. This patch does not try to
> workaround older kernels by doing PTRACE_ATTACH.
I had something somewhat working using ptrace attach and the
elf_from_remote_memory that we are already using for getting access to
the vdso. But I had trouble with the alignment requirements not always
working and there was the issue of how to pass through the pid of the
process from the report callback to the find_elf callback. I'll see if I
can make that work using your approach and then we can maybe use that as
fallback when direct access doesn't work on older kernels.
There was one obvious typo in elf_from_remote_memory that I just checked
in. See attached. Still looking at the alignment issues I seem to have
had in handle_segment. I got something somewhat working some time back,
but I don't understand my own patches... (most are really just lots of
extra debug output).
Cheers,
Mark