From 60b55c4c181b1ef0cb3080cc797853c88872e748 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 7 Aug 2011 11:04:32 +0000 Subject: * fhandler_process.cc (format_process_maps): Actually print info about the application heap of the printed process, not of the current process. --- winsup/cygwin/fhandler_process.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/fhandler_process.cc') diff --git a/winsup/cygwin/fhandler_process.cc b/winsup/cygwin/fhandler_process.cc index 220d624..a4df4d6 100644 --- a/winsup/cygwin/fhandler_process.cc +++ b/winsup/cygwin/fhandler_process.cc @@ -842,6 +842,11 @@ format_process_maps (void *data, char *&destbuf) pinfo proc_pinfo; if (ReadProcessMemory (proc, &myself, &proc_pinfo, sizeof proc_pinfo, NULL)) proc_pinfo.preserve (); + /* The heap info on the cygheap is also in the same spot in each process + because the cygheap is located at the same address. */ + user_heap_info user_heap; + ReadProcessMemory (proc, &cygheap->user_heap, &user_heap, + sizeof user_heap, NULL); _off64_t len = 0; @@ -976,7 +981,7 @@ format_process_maps (void *data, char *&destbuf) strcpy (posix_modname, "[cygwin-user-shared]"); else if (cur.abase == (char *) *proc_pinfo) strcpy (posix_modname, "[procinfo]"); - else if (cur.abase == cygheap->user_heap.base) + else if (cur.abase == user_heap.base) strcpy (posix_modname, "[heap]"); else posix_modname[0] = 0; -- cgit v1.1