Skip to content


Windows Debugging Tips#


This is a much more powerful debugger than Visual Studio. It’s annoying that the latest verison has to be downloaded as a Windows App Store app


GFlags (the Global Flags Editor), gflags.exe, enables and disables advanced debugging, diagnostic, and troubleshooting features. It is most often used to turn on indicators that other tools track, count, and log.


  • Run GFlags.exe (as admin) to set windows debug settings
  • Can then pass commands to trace stack, trace handles, etc gflags-screenshot.png


Some useful system troubleshooting tools

  • SysInternals: WinObj
  • Shows all the OS objects
  • SigCheck -a sftvolwin7.sys
  • Verify valid signature and shows file version info
  • TCPView
  • See all network traffic
  • Procmon
  • Count Occurrences Result will collate all errors
  • WindowsSDK\Debuggers\x64\gflags.exe

WinDBG Commands#


  • !locks

Hang analysis#

  • !analyze -v -hang
  • Look at the stack and rerun the stack dump command (eg: ~0s ; .cxr ; kb)
  • Most likely will be NtWaitForSingleObject.  Grab the handle pointer and fe


  • !uniqstack
  • !findstack

Crash Dump Analysis#

Use windbg.exe to open dump file and use following command: !analyze -v


Misc Commands#

Debug Commands:

k: Display backtrace

WinDBG hardware breakpoints

bp  Address breakpoint
bu  Unresolved/deferred breakpoint. Persists across module load/unload
bm  Set symbol breakpoint on pattern match
bc/bd/be    Clear/enable/disable BP

Can also do breakpoint commands. Ex:

0:000> bu MyFunction+0x47 ".dump c:\mydump.dmp; g"
bl  List existing breakpoints
ba  Set Read Data breakpoint

Complex DataAccess breakpoints:

Last update: August 23, 2021