preloader: Add a debug option to dump memory maps.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-04-27 15:03:46 +02:00
parent c92189c600
commit 1172754fcb
1 changed files with 12 additions and 0 deletions

View File

@ -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;
}