-
Notifications
You must be signed in to change notification settings - Fork 206
Debugging on Windows
Microsoft's WinDbg program offers many helpful features for debugging both release and debug builds of Gaffer. This page gives tips on using it for common tasks. It can be installed from the Windows app store.
If you are debugging a problem that occurs after starting Gaffer, attaching to a running Gaffer process is usually the easiest way to connect WinDbg to Gaffer. To do so :
- Start Gaffer and WinDbg
- Once Gaffer is started, go to the
File
menu of WinDbg. SelectAttach To Process
and find the Gaffer process. It will actually be calledpython.exe
, which you can search for in the box at the top right of the window - WinDbg will load some modules, attach itself to the Gaffer python process, and pause Gaffer. Press the "Go" button to resume Gaffer
The main window of WinDbg is a command panel by default. It will show what WinDbg is doing as you debug, and you can also execute commands specific to WinDbg. The picture below shows an example of exporting a stack trace and where to enter debug commands.
There is a dedicated panel for the call stack, but it can also be useful to export the stack trace for sharing. You can export the stack trace using the .dump <output path.dmp>
command in WinDbg's command window.
You can load a stack trace from the File
menu of WinDbg and selecting Open Dump File
and browsing to the debug file.