Extending /proc/*/maps

Ryan Johnson ryan.johnson@cs.utoronto.ca
Wed May 11 05:28:00 GMT 2011


Hi all,

Please find attached three patches which extend the functionality of 
/proc/*/maps.

The first (proc-maps-files) makes format_process_maps report all 
reserved or committed address space, rather than just the parts occupied 
by dlls in the dll_list. It splits allocations when they have multiple 
sets of permissions (with proper file offsets when appropriate), 
displays the file name of all mapped images and files, and identifies 
shared memory segments.

The second (proc-maps-heaps) adds reporting of Windows heaps (or their 
bases, at least). Unfortunately there doesn't seem to be any efficient 
way to identify all virtual allocations which a heap owns.

The third (proc-maps-safe) adds a "safe" mode and helper function which 
allows to print the process map at early stages of process startup when 
cygwin1.dll is not initialized yet. It is provided in case anyone finds 
it helpful; I don't expect it to migrate upstream.

Changelog entries also attached...

NOTE 1: I do not attempt to identify PEB, TEB, or thread stacks. The 
first could be done easily enough, but the second and third require 
venturing into undocumented/private Windows APIs.

NOTE 2: If desired, we could easily extend format_process_maps further 
to report section names of mapped images (linux does this for .so 
files), using the pe/coff file introspection class that accompanies my 
fork patches (separate email). I did not implement it because I don't 
know if people want that functionality. I haven't needed it yet.

Thoughts?
Ryan


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: proc-maps-files.patch
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110511/0710d89c/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: proc-maps-heaps.patch
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110511/0710d89c/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: proc-maps-safe.patch
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110511/0710d89c/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: proc-changes.txt
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20110511/0710d89c/attachment.txt>


More information about the Cygwin-patches mailing list