This is an old revision of the document!


How to debug D3D9

Compile both Mesa-3D and Wine with CFLAGS and CXXFLAGS set to debug.

CFLAGS="-Og -ggdb -pg -g -gdwarf-2 -gstrict-dwarf" CXXFLAGS="${CFLAGS}"
  • -Og is better than -O0 and disable optimalization which interfere with debug (gcc >= 4.8)
  • -ggdb, -pg, -g add debug informations to code
  • -gdwarf-2, -gstrict-dwarf limit DWARF version to 2. It's necessary for both, because wine support is limited to version 2.

Also configure Mesa-3D with

--enable-debug

It depends on issue, you need to figure out, where is problem. If it's in mesa, you'll need use NINE_DEBUG variable, to know what D3D9 ST doing. For wine, WINEDEBUG=+d3dadapter9,+d3d9 should be enough.

You maybe also interested in apitrace.

APITrace
  • For debugging Windows application you'll need APITrace compiled for Windows
  • Windows version is almost always required for replaying

Code: https://github.com/apitrace/apitrace Windows version: http://people.freedesktop.org/~jrfonseca/apitrace/