Hopefully a simple question on /proc/pid/mem

Richard F Weber
2001-04-30T17:50:22Z

Hopefully this is a simple question. I'm trying to work on an external
debugger that can bind to an external process, and open up memory
locations on the heap to allow reading of data.

Now I've tried using ptrace(), mmap() & lseek/read all with no success.
The closest I've been able to get is to use ptrace() to do an attach to
the target process, but couldn't read much of anything from it. Plus
I've seen tons of conflicting reports saying that each on is the best,
and the other two are deprecated.

So what I'd appreciate help in is:

1) Which approach to use?
2) Maybe a sample program that lets me read address 0x8000000 from
another process. I know this address is an integer, but I can't ever
mmap, read or do a PEEKDATA on it.

Thanks in Advance to any pointers or help you can provide.I can provide
sample code to stuff I've tried, or any other information if it will
help. Thanks.

--Rich