Alexandre Julliard : preloader: Add a debug option to dump memory maps.

Alexandre Julliard julliard at winehq.org
Thu Apr 27 15:49:10 CDT 2017


Module: wine
Branch: master
Commit: 1172754fcbbcf5769edbba8a3e76a604c487af6e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1172754fcbbcf5769edbba8a3e76a604c487af6e

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Apr 27 15:03:46 2017 +0200

preloader: Add a debug option to dump memory maps.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 loader/preloader.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/loader/preloader.c b/loader/preloader.c
index 7cf2946..91ad1da 100644
--- a/loader/preloader.c
+++ b/loader/preloader.c
@@ -127,6 +127,7 @@ static struct wine_preload_info preload_info[] =
 #undef DUMP_SEGMENTS
 #undef DUMP_AUX_INFO
 #undef DUMP_SYMS
+#undef DUMP_MAPS
 
 /* older systems may not define these */
 #ifndef PT_TLS
@@ -1272,6 +1273,17 @@ void* wld_start( void **stack )
     wld_printf("new stack = %p\n", *stack);
     wld_printf("jumping to %p\n", (void *)ld_so_map.l_entry);
 #endif
+#ifdef DUMP_MAPS
+    {
+        char buffer[1024];
+        int len, fd = wld_open( "/proc/self/maps", O_RDONLY );
+        if (fd != -1)
+        {
+            while ((len = wld_read( fd, buffer, sizeof(buffer) )) > 0) wld_write( 2, buffer, len );
+            wld_close( fd );
+        }
+    }
+#endif
 
     return (void *)ld_so_map.l_entry;
 }




More information about the wine-cvs mailing list