Need help debugging ...

Mike Hearn mike at
Sat Jan 17 07:21:47 CST 2004

On Fri, 16 Jan 2004 23:19:33 +0000, Jason Edmeades wrote:
>> 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. 

You're significantly better at this than I am! "Some debugging" is a bit
vague but I'll let you off that ;) I guess I just need to get better at
reading disassemblies.

> Hmmm.
> 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.

Are you sure that's the prototype of the entry point? I suspect it's
actually a WinMain as Andreas suggested... that would make sense, you
don't need to make an API call to get the path then.

> 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

Doh. Well this should definately be fixed anyway (with a regression test),
and it does sound a lot like the problem doesn't it? I expect we use this
API (or similar) to set the parameters to WinMain.

thankyou very much! I learnt something today -mike

More information about the wine-devel mailing list