[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: Cross-debugging & PROCESS_Start
From:       Ulrich Weigand <weigand () informatik ! uni-erlangen ! de>
Date:       1999-09-29 12:00:49
[Download RAW message or body]


Gavriel State <oponvybl@umail.corel.com> wrote:

> But I don't understand enough about how relay debugging works to know if 
> this would really break things.  More specifically, I don't understand why 
> the LoadLibrary has to take place before calling the UserSignalProcs at all.  

The reason why I added the LoadLibrary call is that the UserSignalProc
is called via a Callout pointer, which in turn is retrieved via
GetProcAddress().   Now, normally this works just fine, but if relay
debugging is active, GetProcAddress() doesn't return the actual function,
but instead the address of a relay debugging stub.  This is why calling
the UserSignalProc results in the corresponding relay messages.

The problem is, however, that the relay debugging stub (and the output
routines called by the stub) must find out the name/ordinal of the
routine just being called.  To do so, it calls BUILTIN32_GetEntryPoint,
which in turn scans the list of routines exported by all currently
loaded built-in libraries.  If the library to which the entry point
belongs isn't actually loaded, the entry point can't be found, and 
thus the relay debugging crashes (it can't really continue, as even 
the real address of the function to be called is not known!).


As Alexandre said, the proper fix would be to delay the sending of
LoadLibrary debug events until the time the DLL_PROCESS_ATTACH calls
are done. (This would also fix another race condition if a process can't
be loaded because a DLL turns out to be missing ...) Alternativly, you 
could just comment out *both* the LoadLibrary and the UserSignalProc calls:
the built-in USER doesn't do anything in the process-creation SignalProc 
calls anyway; they are just done for the benefit of native USER.

Bye,
Ulrich


=========================================================================

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic