From: "Richard F Weber" <rfweber@link.com>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: linux-mm@kvack.org
Subject: Re: Hopefully a simple question on /proc/pid/mem
Date: Mon, 30 Apr 2001 15:13:10 -0400 [thread overview]
Message-ID: <3AEDB946.2060708@link.com> (raw)
In-Reply-To: <20010430195007.F26638@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1651 bytes --]
Well ptrace connects, but getting the data out is what seems to be the
really tough part. I've seen some examples of opening up the
/proc/pid/mem file just using the
.................
int addr=0x<some memory address>;
char buffer[255];
proc_file=open ("/proc/pid/mem",O_RDONLY);
lseek(proc_file,addr,SEEK_SET);
read (proc_file,buffer,sizeof(buffer));
.................
But then the system complains about "No Such Process". I know the
process is working and this fails as both the user running the target
process, as well as root. I'm also using a 2.2.16 kernel stock from
RH7.0 (but I didn't think that would really matter). I don't need
register access (at least not yet).
The only other thing I'm wondering is if there is some permission that
must be granted by the target process, but I've already tried the
ptrace(PTRACE_TRACEME) line.
Thanks.
--Rich
Stephen C. Tweedie wrote:
>Hi,
>
>On Mon, Apr 30, 2001 at 02:17:13PM -0400, Richard F Weber wrote:
>
>>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.
>>
>
>ptrace is what other debuggers use. It really ought to work.
>
>Cheers,
> Stephen
>--
>To unsubscribe, send a message with 'unsubscribe linux-mm' in
>the body to majordomo@kvack.org. For more info on Linux MM,
>see: http://www.linux.eu.org/Linux-MM/
>
[-- Attachment #2: Type: text/html, Size: 2168 bytes --]
prev parent reply other threads:[~2001-04-30 18:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-30 18:17 Richard F Weber
2001-04-30 18:50 ` Stephen C. Tweedie
2001-04-30 19:00 ` Alexander Viro
2001-04-30 19:02 ` Benjamin C.R. LaHaise
2001-04-30 19:26 ` Alexander Viro
2001-04-30 19:26 ` Benjamin C.R. LaHaise
2001-04-30 19:44 ` Alexander Viro
2001-04-30 21:58 ` Stephen C. Tweedie
2001-05-01 1:13 ` Eric W. Biederman
2001-05-01 9:36 ` Stephen C. Tweedie
2001-05-01 15:16 ` Eric W. Biederman
2001-04-30 19:13 ` Richard F Weber [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3AEDB946.2060708@link.com \
--to=rfweber@link.com \
--cc=linux-mm@kvack.org \
--cc=sct@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox