Debugging Wine thoughts

Markus Hitter mah at jump-ing.de
Thu Sep 11 06:20:42 CDT 2008


Am 10.09.2008 um 17:32 schrieb Stefan Dösinger:

> You can attach any debugger to a Win32 process running in Wine. This
> includes Linux debuggers like gdb, [...]

As I didn't find hints on how to do this I tried myself:

** First, start gdb in the C: directory

mah at piccard:/otherubuntu/home/mah/.wine/drive_c$ gdb
GNU gdb 6.8-debian
Copyright [...]
This GDB was configured as "x86_64-linux-gnu".
(gdb) file wine
Reading symbols from /usr/local/bin/wine...done.
(gdb) directory /otherubuntu/home/mah/wine/
Source directories searched: /otherubuntu/home/mah/wine:$cdir:$cwd
(gdb)

** Then, run the app

(gdb) run windows/notepad.exe
Starting program: /usr/local/bin/wine windows/notepad.exe
[Thread debugging using libthread_db enabled]
[New Thread 0xf7c628c0 (LWP 793)]
[New Thread 0xf7c61b90 (LWP 796)]
[Thread 0xf7c61b90 (LWP 796) exited]
[New process 793]
Executing new program: /usr/local/bin/wine-preloader
warning: Cannot initialize thread debugging library: generic error
warning: Cannot initialize thread debugging library: generic error
[New process 793]
Fontconfig warning: "/etc/fonts/conf.d/53-monospace-lcd-filter.conf",  
line 17: invalid constant used : lcdlegacy
Fontconfig warning: "/etc/fonts/conf.d/53-monospace-lcd-filter.conf",  
line 17: invalid constant used : lcdlegacy
Fontconfig warning: "/etc/fonts/conf.d/53-monospace-lcd-filter.conf",  
line 17: invalid constant used : lcdlegacy

** Notepad should be running here. Interrupt it from the command line  
to have a look:

^C
Program received signal SIGINT, Interrupt.
0xf7fec430 in ?? ()
(gdb) bt
#0  0xf7fec430 in ?? ()
#1  0x00000008 in ?? ()
#2  0x7bc76516 in ?? ()
#3  [...]
(gdb) list
1	/*
2	 * Preloader for ld.so
3	 *
4	 * Copyright (C) [...]

As you see, listing appears to work in principle, while symbol lookup  
doesn't.

It's no secret Wine runs multiple processes and Windows applications  
run multiple threads, so you might want to look up how to handle this  
in gdb:

http://sources.redhat.com/gdb/current/onlinedocs/gdb_5.html

My tries to break not into the preloader, but the actual Windows  
application weren't successful so far, gdb's console appears to lock  
up somehow when setting follow-fork-mode & friends.


MarKus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/







More information about the wine-devel mailing list