From: Zinx Verituse <zinx@epicsol.org>
To: linux-kernel@vger.kernel.org
Subject: mmap /proc/<pid>/mem ... alternatives?
Date: Fri, 7 Jun 2002 02:38:51 -0500 [thread overview]
Message-ID: <20020607073851.GA24365@bliss> (raw)
I have a black-box process (of which I can disassemble enough to
insert debugging traps). I need to read a large number of sparse
structures that are a few bytes to a few hundred kbyte each. In
Linux 2.2, I was simply mmap()ing the process's memory, but that
feature seems removed in Linux 2.4, so.. I need alternatives..
Here's a list of things I'm considering:
provide mmap() patch for /proc/<pid>/mem
Definitely out of my league :)
mmap() of /dev/mem
needs root (I can live with that)
need to know where the process's memory is --
I don't know how to determine this.
shared memory
need to bootstrap some code at the beginning (doable)
I don't know how to re-map the data, bss, and stack to
shared memory properly.
use read/write on /proc/<pid>/mem
write() doesn't work (doesn't write to the process).
complicates the code in my program quite a bit.
hybrid read, ptrace(PTRACE_POKEDATA, ...)
works, but I would like to avoid all the extra copies,
and this complicates the code quite a bit.
downgrade to 2.2
Only as an absolute last resort, if nothing else works.
--
Zinx Verituse
reply other threads:[~2002-06-07 7:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20020607073851.GA24365@bliss \
--to=zinx@epicsol.org \
--cc=linux-kernel@vger.kernel.org \
/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