CS 2301

Lab 6 - DDD, the Data Display Debugger

Objectives

Introduction

One of the most important skills you can learn in an introductory computer science course is how to debug your programs. A few weeks ago, we learned how to use gdb, the Gnu Debugger, to debug our C programs. While gdb is extremely powerful for debugging all kinds of programs in great detail, it is onerous for ordinary users because it demands that you learn and remember a command-line language. Most modern development environments provide graphical user interfaces to their debuggers. These are vast improvements that let you look at larger areas of your program as a unit, visually track variables as they change, invoke commands from easy-to-use menus and buttons, visualize breakpoints, etc.

DDD, the Data Display Debugger, is a visual front-end for gdb. It provides all of the power of gdb while providing the advantages of a graphical user interface. You can see your program, its break-points, its status as you single-step, its variables, and important messages. You also have access to a gdb window, in which you can execute a gdb command for specialized situations.

The entire DDD manual can be found at the following URL:

http://web.cs.wpi.edu/~cs2301/d12/Common/DDD_documentation.pdf

This is over 200 pages long, so don't try to print a copy until you really need it.

What you should do...

  1. Sign the attendance sheet.

  2. In a window on your PC, open the following URL

    http://web.cs.wpi.edu/~cs2301/d12/Common/DDD_Sample_session.pdf

    This is a tutorial excerpted from the DDD manual.

  3. Create a directory in your CCC account to hold the file for Lab 6, and change to that directory now. Use kwrite or your favorite editor to create a new file called sample.c. Copy and paste the program sample.c from the last page of the tutorial to your file.

  4. Compile sample.c with the command

    gcc -g -Wall -o sample sample.c

    The program should compile with no errors.

  5. Execute the following command in your command shell window, and follow the tutorial.

    ddd sample

  6. Finish the tutorial by fixing sample.c, rebuilding it, and running it correctly. When you have finished, turn in your modified sample.c using web-based turnin. The name of the turnin project is Lab 6.

    This is the last lab. Good luck on your finals!