* fhandler_process.cc (thread_info::fill_if_match): Reformat.
(format_process_maps): Ditto. Fetch pointer to procinfo structure from mapped process. Print info about global shared Cygwin regions.
This commit is contained in:
parent
6b58abe537
commit
7d375b5a65
@ -1,3 +1,9 @@
|
|||||||
|
2011-05-23 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_process.cc (thread_info::fill_if_match): Reformat.
|
||||||
|
(format_process_maps): Ditto. Fetch pointer to procinfo structure
|
||||||
|
from mapped process. Print info about global shared Cygwin regions.
|
||||||
|
|
||||||
2011-05-21 Corinna Vinschen <corinna@vinschen.de>
|
2011-05-21 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_process.cc (struct dos_drive_mappings): Use malloc/free
|
* fhandler_process.cc (struct dos_drive_mappings): Use malloc/free
|
||||||
|
@ -795,11 +795,9 @@ struct thread_info
|
|||||||
|| (r->teb && wincap.is_wow64 ()
|
|| (r->teb && wincap.is_wow64 ()
|
||||||
&& r->start == base + 2 * wincap.page_size ()))
|
&& r->start == base + 2 * wincap.page_size ()))
|
||||||
{
|
{
|
||||||
char *p;
|
char *p = dest + __small_sprintf (dest, "[%s (tid %ld)",
|
||||||
|
r->teb ? "teb" : "stack",
|
||||||
p = dest + __small_sprintf (dest, "[%s (tid %ld)",
|
r->thread_id);
|
||||||
r->teb ? "teb" : "stack",
|
|
||||||
r->thread_id);
|
|
||||||
if (type & MEM_MAPPED)
|
if (type & MEM_MAPPED)
|
||||||
p = stpcpy (p, " shared");
|
p = stpcpy (p, " shared");
|
||||||
stpcpy (p, "]");
|
stpcpy (p, "]");
|
||||||
@ -824,8 +822,7 @@ format_process_maps (void *data, char *&destbuf)
|
|||||||
{
|
{
|
||||||
_pinfo *p = (_pinfo *) data;
|
_pinfo *p = (_pinfo *) data;
|
||||||
HANDLE proc = OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
|
HANDLE proc = OpenProcess (PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
|
||||||
FALSE,
|
FALSE, p->dwProcessId);
|
||||||
p->dwProcessId);
|
|
||||||
if (!proc)
|
if (!proc)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -833,10 +830,16 @@ format_process_maps (void *data, char *&destbuf)
|
|||||||
PROCESS_BASIC_INFORMATION pbi;
|
PROCESS_BASIC_INFORMATION pbi;
|
||||||
PPEB peb = NULL;
|
PPEB peb = NULL;
|
||||||
|
|
||||||
|
memset (&pbi, 0, sizeof (pbi));
|
||||||
status = NtQueryInformationProcess (proc, ProcessBasicInformation,
|
status = NtQueryInformationProcess (proc, ProcessBasicInformation,
|
||||||
&pbi, sizeof pbi, NULL);
|
&pbi, sizeof pbi, NULL);
|
||||||
if (NT_SUCCESS (status))
|
if (NT_SUCCESS (status))
|
||||||
peb = pbi.PebBaseAddress;
|
peb = pbi.PebBaseAddress;
|
||||||
|
/* myself is in the same spot in every process, so is the pointer to the
|
||||||
|
procinfo. But make sure the destructor doesn't try to release procinfo! */
|
||||||
|
pinfo proc_pinfo;
|
||||||
|
if (ReadProcessMemory (proc, &myself, &proc_pinfo, sizeof proc_pinfo, NULL))
|
||||||
|
proc_pinfo.preserve ();
|
||||||
|
|
||||||
_off64_t len = 0;
|
_off64_t len = 0;
|
||||||
|
|
||||||
@ -965,6 +968,12 @@ format_process_maps (void *data, char *&destbuf)
|
|||||||
strcpy (posix_modname, "[peb]");
|
strcpy (posix_modname, "[peb]");
|
||||||
else if (cur.abase == (char *) &SharedUserData)
|
else if (cur.abase == (char *) &SharedUserData)
|
||||||
strcpy (posix_modname, "[shared-user-data]");
|
strcpy (posix_modname, "[shared-user-data]");
|
||||||
|
else if (cur.abase == (char *) cygwin_shared)
|
||||||
|
strcpy (posix_modname, "[cygwin-shared]");
|
||||||
|
else if (cur.abase == (char *) user_shared)
|
||||||
|
strcpy (posix_modname, "[cygwin-user-shared]");
|
||||||
|
else if (cur.abase == (char *) *proc_pinfo)
|
||||||
|
strcpy (posix_modname, "[procinfo]");
|
||||||
else
|
else
|
||||||
posix_modname[0] = 0;
|
posix_modname[0] = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user