Subject: Re: PT_MEMMAP
To: Love <lha@stacken.kth.se>
From: Gregory McGarry <g.mcgarry@ieee.org>
List: tech-kern
Date: 07/26/2002 09:19:11
Love wrote:

> Gregory McGarry <g.mcgarry@ieee.org> writes:
> 
> > > I can see why you think this is useful. This exists in the linux procfs
> > > support, if you just the filename. I don't really care about if it should
> > > be included or not, so its up to others to say so. It should be somewhat
> > > easy to add.
> > 
> > I think it is useful.
> 
> I did add support for this [1], I guess I should also store fsid/fileid
> with the path. (the proc_vnode_to_path is shared with procfs). See comment
> below.
> 
> : lha@nutcracker ; od &
> [1] 303
> : lha@nutcracker ; ./pmap 303
> start: 08048000 end: 0804c000   r-x rwx COW  NC   obj 0 1 0     /usr/bin/od
> start: 0804c000 end: 0804d000   rw- rwx COW  NNC  anon 0 1 0
> start: 0804d000 end: 0805f000   rwx rwx COW  NNC  anon 0 1 0
> start: 4804c000 end: 48055000   r-x rwx COW  NC   obj 0 1 0     /usr/libexec/ld.elf_so
> start: 48055000 end: 48056000   rw- rwx COW  NNC  obj 0 1 0     /usr/libexec/ld.elf_so
> start: 48056000 end: 4805f000   rw- rwx COW  NNC  anon 0 1 0
> start: 4805f000 end: 480ec000   r-x rwx COW  NC   obj 0 1 0     /usr/lib/libc.so.12.85
> start: 480ec000 end: 480f1000   rw- rwx COW  NNC  obj 0 1 0     /usr/lib/libc.so.12.85
> start: 480f1000 end: 480ff000   rw- rwx COW  NNC  anon 0 1 0
> start: bdbfe000 end: bf9fe000   --- rwx COW  NC   anon 0 1 0
> start: bf9fe000 end: bfbf0000   rwx rwx COW  NC   anon 0 1 0

I like it!

> http://www.e.kth.se/~lha/patches/netbsd/gdb-core/ptrace-patch2

Check out ktrsyscall()/ktrwrite() for a clean way to do the uiomove
stuff.

I'm not sure whether the use of getcwd_common() isn't a horrible hack.
It doesn't seem like the right thing to do.

	-- Gregory McGarry <g.mcgarry@ieee.org>