Windows Debugging

From K-3D

Jump to: navigation, search

Overview

  • Download and install Cygwin.
  • Install the Cygwin gdb package.
  • In a Cygwin shell, start the debugging session:
$ gdb k3d.exe
  • In the debugger, execute K-3D:
(gdb) run
  • Due to some weirdness in the Microsoft C Runtime, the program will receive a SIGTRAP signal during startup. SIGTRAP is the signal that is normally used by debuggers to stop execution at breakpoints. There are two ways to get beyond this point in execution:
  • Manually continue execution (you will have to do this many times during startup - after the first time just hit "Enter" to keep repeating the last command):
(gdb) continue
  • Tell gdb to stop handling the SIGTRAP signal:
(gdb) handle SIGTRAP nostop
(gdb) continue
  • Once you reach a point where the program fails, take note of any error messages / gdb output, and get a backtrace:
(gdb) bt