Hel debugging windows app with wine(dbg) + gdb

Peter Hartshorn peter at dimtech.com.au
Thu Jan 29 17:48:42 CST 2004

Here is my debugging tip:

printf is your friend.

If you can narrow down the error to the function at which it occurs, place a 
printf, or fprintf to stderr, after every line of code. The last message that 
is printed should get you a lot closer to your error.

On Friday 30 January 2004 09:57, Leo wrote:
> Hi,
> I don't know if this is the place to ask this, but anyway here it goes:
> I'm trying to debug a windows application using wine.
> The app is compiled with mingw (www.mingw.org), and I tried using
> -gstabs and -ggdb debug info but same problem happens.
> The problem is:
> 1) Using winedbg as server for remote gdb debugger, when execution stops
> (sigfault, or whatever), and I type 'bt' in the gdb client, no debug
> info is shown, just lines like this one:
> #0  0xdeaf1005 in ?? ()
> 2) Running 'wine <myapp.exe>' and then using gdb client to debug the
> process with the 'attach' command, when execution stops (sigfault, or
> whatever), and I type 'bt' in the gdb client, debug info IS shown, but
> line numbering shows always just the first line in the function.
> For example, say I have this function:
> void f()
> {
>     int a=123;
>     *(char *)0=a;
> }
> then when sigfault is caught, gdb shows backtrace like this:
> #0  0x0040130b in f() () at f.cpp:2
> even though exception occurs in line 4.
> Either way,  I can't debug a windows app correctly.
> May I be doing something wrong.
> I've read the docs and followed instructions for DDD, KDbg, and just
> plain gbd.
> I'm using latest wine 2004 rpm under Redhat 9.
> Any help greatly appreciated.
> Thanks,
> Leo.

More information about the wine-devel mailing list