CSC 161 Grinnell College Spring, 2009
Imperative Problem Solving and Data Structures

Gnu's DDD Debugger


This reading provides some background on the DDD debugger.


Please follow these steps as you prepare for this laboratory session.

  1. Use your favorite web browser to view the manual provided by Gnu for DDD (html version):

  2. Follow the link for Sample Session. It should be the second item in the list.

  3. Click on Sample Program to view the sample program, then cut and paste the program into a new file, sample.c, in your current directory.

  4. Compile the sample program (to an executable named sample) with the following command. The option -gstabs causes the executable to contain information needed by the debugger. In case you are curious, "stabs" here stands for "symbol tables."

      gcc -Wall -ansi -gstabs -o sample sample.c
  5. Return to Gnu's sample DDD session (i.e., go back a page in your browser).

This document is available on the World Wide Web as

created February 2007 by Marge Coahran
restructured 4 May 2008 by Henry M. Walker
last revised 18 January 2009
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at