Wine isn't perfect, and many Windows applications still don't run without bugs under Wine (but then, a lot of programs don't run without bugs under native Windows either!). To make it easier for people to track down the causes behind each bug, Wine provides a number of debug channels that you can tap into.
Each debug channel, when activated, will trigger logging
messages to be displayed to the console where you invoked
wine. From there you can redirect the
messages to a file and examine it at your leisure. But be
forewarned! Some debug channels can generate incredible
volumes of log messages. Among the most prolific offenders
are relay
which spits out a log
message every time a win32 function is called,
win
which tracks windows message
passing, and of course all
which is
an alias for every single debug channel that exists. For a
complex application, your debug logs can easily top 1 MB and
higher. A relay
trace can often
generate more than 10 MB of log messages, depending on how
long you run the application. (You'll want to check out
RelayExclude registry key to
modify what the relay
trace reports).
Logging does slow down Wine
quite a bit, so don't use WINEDEBUG
unless you really do want log files.
Within each debug channel, you can further specify a
message class, to filter out the
different severities of errors. The four message classes
are:
trace
, fixme
, warn
, err
.
To turn on a debug channel, use the form
class+channel
. To turn it off, use
class-channel
. To list more than one
channel in the same WINEDEBUG
option, separate them with commas. For example, to request
warn
class messages in the
heap
debug channel, you could invoke
wine like this:
$ WINEDEBUG=warn+heap wine program_name
If you leave off the message class, wine will display messages from all four classes for that channel:
$ WINEDEBUG=heap wine program_name
If you wanted to see log messages for everything except the relay channel, you might do something like this:
$ WINEDEBUG=+all,-relay wine program_name
Here is a list of the debug channels and classes in Wine. More channels will be added to (or subtracted from) later versions.
Table 4-1. Debug Channels
accel | adpcm | advapi | animate | aspi |
atom | avicap | avifile | bidi | bitblt |
bitmap | cabinet | capi | caret | cdrom |
cfgmgr32 | class | clipboard | clipping | combo |
comboex | comm | commctrl | commdlg | computername |
console | crtdll | crypt | curses | cursor |
d3d | d3d_shader | d3d_surface | datetime | dc |
ddeml | ddraw | ddraw_fps | ddraw_geom | ddraw_tex |
debugstr | devenum | dialog | dinput | dll |
dma | dmband | dmcompos | dmfile | dmfiledat |
dmime | dmloader | dmscript | dmstyle | dmsynth |
dmusic | dosfs | dosmem | dplay | dplayx |
dpnhpast | driver | dsound | dsound3d | edit |
enhmetafile | environ | event | eventlog | exec |
file | fixup | font | fps | g711 |
gdi | global | glu | graphics | header |
heap | hook | hotkey | icmp | icon |
imagehlp | imagelist | imm | int | int21 |
int31 | io | ipaddress | iphlpapi | jack |
joystick | key | keyboard | listbox | listview |
loaddll | local | mapi | mci | mcianim |
mciavi | mcicda | mcimidi | mciwave | mdi |
menu | menubuilder | message | metafile | midi |
mmaux | mmio | mmsys | mmtime | module |
monthcal | mpeg3 | mpr | msacm | msdmo |
msg | mshtml | msi | msimg32 | msisys |
msrle32 | msvcrt | msvideo | mswsock | nativefont |
netapi32 | netbios | nls | nonclient | ntdll |
odbc | ole | oledlg | olerelay | opengl |
pager | palette | pidl | powermgnt | |
process | profile | progress | propsheet | psapi |
psdrv | qcap | quartz | ras | rebar |
reg | region | relay | resource | richedit |
rundll32 | sblaster | scroll | seh | selector |
server | setupapi | shdocvw | shell | shlctrl |
snmpapi | snoop | sound | static | statusbar |
storage | stress | string | syscolor | system |
tab | tape | tapi | task | text |
thread | thunk | tid | timer | toolbar |
toolhelp | tooltips | trackbar | treeview | ttydrv |
twain | typelib | uninstaller | updown | urlmon |
uxtheme | ver | virtual | vxd | wave |
wc_font | win | win32 | wineboot | winecfg |
wineconsole | wine_d3d | winevdm | wing | winhelp |
wininet | winmm | winsock | winspool | wintab |
wintab32 | wnet | x11drv | x11settings | xdnd |
xrandr | xrender | xvidmode |
For more details about debug channels, check out the The Wine Developer's Guide.
It's not always possible to run an application on builtin DLL's. Sometimes native DLL's simply work better. Altough these DLL overrides can be set using winecfg you might want to use the WINEDLLOVERRIDES environment variable to set them.
For example, if you wanted wine to use native ole32.dll, oleaut32.dll and rpcrt4 you could run wine like this:
$ WINEDLLOVERRIDES="ole32,oleaut32,rpcrt4=n" wine program_name
For more information about DLL overrides, please refer to the DLL overrides section of this guide.
If you are using the OSS audio driver and you have multiple devices, (i.e. /dev/dsp*, /dev/mixer*) you can specify which one you want to use with the following environment variables:
AUDIODEV=[audio device]
MIXERDEV=[mixer device]
MIDIDEV=[MIDI device]
As an example:
$ AUDIODEV=/dev/dsp4 MIXERDEV=/dev/mixer1 MIDIDEV=/dev/midi3 wine program_name