This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: Extending /proc/*/maps
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Wed, 11 May 2011 12:31:49 +0200
- Subject: Re: Extending /proc/*/maps
- References: <4DCA1E59.4070800@cs.utoronto.ca>
- Reply-to: cygwin-patches at cygwin dot com
Hi Ryan,
On May 11 01:27, Ryan Johnson wrote:
> Hi all,
>
> Please find attached three patches which extend the functionality of
> /proc/*/maps.
Thanks!
I applied youyr two first patches with a couple of changes:
- Formatting: Setting of curly braces in class and method defintions,
a lot of missing spaces, "int *foo" instead of "int* foo", stuff
like that. Please compare what I checked in against your patch.
That doesn't mean I always get it right myself, but basically that's
how it should be.
- NT_MAX_PATH is the maximum size of a path including the trailing \0,
so a buffer size of NT_MAX_PATH + 1 isn't required.
- Please always use sys_wcstombs rather than wcstombs for filenames.
- I replaced the call to GetMappedFileNameEx with a call to
NtQueryVirtualMemory (MemorySectionName). This avoids to add another
dependency to psapi. I intend to get rid of them entirely, if
possible.
> 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.
Go ahead! We certainly don't shy away from calls to
NtQueryInformationProcess or NtQueryInformationThread.
> 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), [...]
Sorry if I'm dense, but isn't that exactly what GetMappedFileNameEx or
NtQueryVirtualMemory (MemorySectionName) do? I also don't see any extra
information for .so files in the Linux maps output. What detail am I
missing?
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat