CS 190

Debugging Assignment

OUT: March 14, 2001

IN: March 21, 2001




This assignment is intended to give you a chance to demonstrate that you know how to step through code, ala Macguire.


You should


1) Write some code. Choose one C++ file with at least 10 lines of interesting code in a row. The code should contain some non-linear flow of control (loop, if/then/else, goto). Use code for your project. If you don't have primary responsibility for coding, find a piece to implement. Get the code into a testable state. Generally, that means that it compiles and that you can get to the first line of code in each routine in the debugger. You can use old code, if you want.


2) Reread Macguire's description of how to step through code.


3) Set up to record your dbx session (use ``script'' or cut-and-paste).


4) Step through the 10+ lines of code in dbx. Follow the guidelines from Writing Solid Code chapter 4 on how to do this. The idea is to check variable values and other state information before and after execution of each line and verify that the line did what you expected.


5) Hand in your dbx transcript.




David Laidlaw, dhl@cs.brown.edu