Lab-6

Debugger

Pre-lab Exercises

      Go through online videos, demonstrating the basic debugging techniques. Some useful links are given below:

Announcements

Lab Grading policy  

There are 3 questions. The maximum score is 2, where each question is worth 1 point. Question 3 is extra credit. To get a grade, you must demonstrate the assignments to a TA, & submit the work onto Blackboard before your lab session ends. Late submission is not accepted. Once you finish your work, please raise your hand and show your work to the TA during the last 10 minutes of lab or whenever you finish, the earlier of the two. 

Lab Activity

Lab 6 is designed to practice & gain some insight into program debugging. 

Prior to this, most of you have been using printf (and similar display functions) for debugging your code to find issues/bugs. Writing code to debug issues in the code seems fine when the code size is limited to a hundred lines or so, but it becomes unusable when you need to write programs that are larger in scale. This is where a "Debugger" steps in. It gives you complete visibility over the execution of your program, where you can stop the program at any point you like, print the values, & go through the execution of the program step by step. Therefore, Lab 6 is designed to give you a hands-on experience of the powerful utility of debuggers.

1. (1 credit) Students must demonstrate how to set a breakpoint and single-step through a program, showing variable values as they go.

2. (1 credit) Students must use problem22() which is shown below, using the debugger to show the first instance where the program execution is not what we intend. 

3. (Extra credit) Students must use problem23() which is shown below, again using the debugger to show the first instance where the program execution is not what we intend. 

The two section of code are in the attachment.  

2-14-2017