Need help debugging ...

Jason Edmeades us at
Fri Jan 16 17:19:33 CST 2004

> The disassembly of the failure shows we have written to eax, and info 
> regs shows eax of 0x00.
> dis 0x4e4a20 shows the routine where the return value is set up in 
> eax, and some debugging shows the initial problem is a path problem. 
> The routine parses the input path which inder windows is 
> c:\path\to\KEEPER95.exe and under wine is KEEPER95. It searches 
> backwards for the last backslash and returns a pointer to the 
> backslash or 0x00. If 0x00, the trap occurs...
> Now the question is where does the full path come from.

Following the path we are playing with back a bit, it is built up and 
looks extremely like the command line (Since if I add command line 
options, they are added as an array to where this comes from).. In fact, 
I can get back to an address where at the very first breakpoint the full 
path is in the place it will be eventually copied from.

Now a simple test pgm:
void main(int count, char *argv[]) {
    printf("Argv[0] = %s\n", argv[0]);

Shows that you only get the program name when run, so it leaves the 
question how the full path is supplied.

With some experimentation with a GUI pgm I think I stumbled upon the / 
an answer:
Bug#1 - GetCommandLine() returns a full path on Windows but no path on Wine
Bug#2 (which will fix bug #1) - Wines PEB stores the short path not the 
full path
Playing with windbg (then ctrl+E to load executable), the peb on windows 
shows the peb->CommandLine is the full path. I suspect this must be the 
bug then, but I cant see the app is accessing this, unless it goes to 
the PEB directly.
0:000> !peb
PEB at 7ffdf000
    WindowTitle:  'C:\temp\wine\dk\test.exe'
    ImageFile:    'C:\temp\wine\dk\test.exe'
    CommandLine:  'C:\temp\wine\dk\test.exe '

However, changing anything to do with paths on wine is an art form to 
itself, so I will leave the fix to someone else!

wine C:\\DK\\KEEPER95   gets things significantely further (flash 
screen) before the next crash.

Thats it for me on this problem, Sorry!

PS Anyone know if MSDEV has the ability to debug pgms under wine yet?
PPS I really wish the winedbg had a memory dump routine (bytes + 
ascii)... is it possible with the cmd set available?

More information about the wine-devel mailing list