Search code examples
gdbcygwin

How to install debugger in Cygwin and use gdb for debugging C programs?


I have Cygwin and want to debug a C program. The gdb command gives 'command not found' error message. How do I get the gdb command to work?

Is there something else I need to install during the Cygwin installion?

Error in Cygwin Terminal: -bash: gdb: command not found


Solution

  • When installing Cygwin (https://cygwin.com/), you have to select the gdb and gdb-debuginfo packages for installation. See required install packages for gdb at [https://cygwin.com/packages/summary/gdb-src.html]

    See below: enter image description here