This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Extending /proc/*/maps
- From: Ryan Johnson <ryan dot johnson at cs dot utoronto dot ca>
- To: cygwin-patches at cygwin dot com
- Date: Wed, 11 May 2011 01:27:53 -0400
- Subject: Extending /proc/*/maps
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
Attachment:
proc-maps-files.patch
Description: Text document
Attachment:
proc-maps-heaps.patch
Description: Text document
Attachment:
proc-maps-safe.patch
Description: Text document
Attachment:
proc-changes.txt
Description: Text document