====== How to debug D3D9 ====== Compile both Mesa-3D and Wine with **CFLAGS** and **CXXFLAGS** set to debug. CFLAGS="-Og -ggdb -g -gdwarf-2 -gstrict-dwarf" CXXFLAGS="${CFLAGS}" * **-Og** is better than -O0 and disable optimalization which interferes with debug (gcc >= 4.8) * **-ggdb, -g** adds debug information to code * **-gdwarf-2, -gstrict-dwarf** limit DWARF version to 2. It's necessary for both, because wine support is limited to version 2. * you can also add **-pg** for profiling. Beware - may cause compilation issues. Also configure Mesa-3D with --enable-debug Make **sure**, you have **disabled striping debug symbols** if you are using distribution packages, ebuild or AUR. A problem can be located in either wine or Mesa. If it's in mesa, you'll need to use [[https://docs.mesa3d.org/envvars.html#nine-frontend-environment-variables]] when you comparing logs from ALWAYS_SOFTWARE, is handy to get rid of different addr for diff, with this helps you ''sed -i -e "s/0x[0-f]*/0x0/g" logfile.log*'' For wine, **WINEDEBUG**=+d3dadapter9,+d3d9 should be enough. You also may be interested in apitrace. == APITrace == {{ :apitrace.png?direct&500|}} * **For apitrace to work, you need to use the no_external_dll branch of iXit/wine!** * For debugging Windows applications you'll need to use APITrace compiled for Windows * The Windows version is almost always required for replaying When uploading APITrace .trace file, please repack it with brotli (best compression -> ''apitrace repack -b your_app.trace your_app-brotli.trace'') * [[https://github.com/apitrace/apitrace/wiki/WINE#windows-native|Wine HOWTO]] * [[http://people.freedesktop.org/~jrfonseca/apitrace/apitrace-msvc-latest.7z|Build suitable for Wine]]