Running valgrind with Wine

Mike McCormack mike at codeweavers.com
Sun Sep 5 09:31:24 CDT 2004


Saulius Krasuckas wrote:

> Possibly, it works.  That just I suck: the patch was not applied. :-/

Well, so long as it's working :)

> Instead I am having trouble compiling the libs/wine dir:
> 
> loader.c:524: conflicting types for `wine_init'
> ../../include/wine/library.h:56: previous declaration of `wine_init'
> 
> NP, that one required just a correction of function prototype in the
> header file.  Wine is recompiling from ground now.  Sorry for the buzz.

OK, I missed that file.  I'll resend the diff incase anybody else is 
interested.

There's probably a better way of doing it so that the wine_init 
prototype isn't changed, but for now at least people can use valgrind 
with the patch...

Mike
-------------- next part --------------
Index: loader/main.c
===================================================================
RCS file: /cvstrees/crossover/office/wine/loader/main.c,v
retrieving revision 1.1.1.11
diff -u -r1.1.1.11 main.c
--- loader/main.c	16 Jun 2004 02:57:30 -0000	1.1.1.11
+++ loader/main.c	5 Sep 2004 12:56:37 -0000
@@ -32,16 +32,17 @@
 int main( int argc, char *argv[] )
 {
     char error[1024];
-    int i;
+    int i, reserve = 0;
 
     if (wine_main_preload_info)
     {
         for (i = 0; wine_main_preload_info[i].size; i++)
             wine_mmap_add_reserved_area( wine_main_preload_info[i].addr,
                                          wine_main_preload_info[i].size );
+        reserve = 1;
     }
 
-    wine_init( argc, argv, error, sizeof(error) );
+    wine_init( argc, argv, error, sizeof(error), reserve );
     fprintf( stderr, "wine: failed to initialize: %s\n", error );
     exit(1);
 }
Index: libs/wine/mmap.c
===================================================================
RCS file: /cvstrees/crossover/office/wine/libs/wine/mmap.c,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 mmap.c
--- libs/wine/mmap.c	31 Jul 2004 00:38:48 -0000	1.1.1.3
+++ libs/wine/mmap.c	5 Sep 2004 12:56:38 -0000
@@ -249,7 +249,7 @@
 /***********************************************************************
  *           mmap_init
  */
-void mmap_init(void)
+void mmap_init(int reserve)
 {
     struct reserved_area *area;
     struct list *ptr;
@@ -258,6 +258,8 @@
     char * const stack_ptr = &stack;
     char *user_space_limit = (char *)0x80000000;
 
+    if( reserve )
+    {
     /* check for a reserved area starting at the user space limit */
     /* to avoid wasting time trying to allocate it again */
     LIST_FOR_EACH( ptr, &reserved_areas )
@@ -285,6 +287,7 @@
     }
     else reserve_area( user_space_limit, 0 );
 #endif /* __i386__ */
+    }
 
     /* reserve the DOS area if not already done */
 
Index: libs/wine/loader.c
===================================================================
RCS file: /cvstrees/crossover/office/wine/libs/wine/loader.c,v
retrieving revision 1.1.1.10
diff -u -r1.1.1.10 loader.c
--- libs/wine/loader.c	16 Jun 2004 02:57:30 -0000	1.1.1.10
+++ libs/wine/loader.c	5 Sep 2004 12:56:39 -0000
@@ -78,7 +79,7 @@
 static int nb_dll_paths;
 static int dll_path_maxlen;
 
-extern void mmap_init(void);
+extern void mmap_init(int reserve);
 
 /* build the dll load path from the WINEDLLPATH variable */
 static void build_dll_path(void)
@@ -511,7 +524,7 @@
  *
  * Main Wine initialisation.
  */
-void wine_init( int argc, char *argv[], char *error, int error_size )
+void wine_init( int argc, char *argv[], char *error, int error_size, int reserve )
 {
     char *wine_debug;
     int file_exists;
@@ -523,7 +536,7 @@
     __wine_main_argc = argc;
     __wine_main_argv = argv;
     __wine_main_environ = environ;
-    mmap_init();
+    mmap_init( reserve );
 
     if ((wine_debug = getenv("WINEDEBUG")))
     {
Index: include/wine/library.h
===================================================================
RCS file: /cvstrees/crossover/office/wine/include/wine/library.h,v
retrieving revision 1.1.1.17
diff -u -r1.1.1.17 library.h
--- include/wine/library.h	16 Jun 2004 02:57:30 -0000	1.1.1.17
+++ include/wine/library.h	5 Sep 2004 12:56:39 -0000
@@ -53,7 +53,7 @@
 extern char **__wine_main_argv;
 extern WCHAR **__wine_main_wargv;
 extern char **__wine_main_environ;
-extern void wine_init( int argc, char *argv[], char *error, int error_size );
+extern void wine_init( int argc, char *argv[], char *error, int error_size, int reserve );
 
 /* debugging */
 


More information about the wine-devel mailing list