Lab-6
Debugger
Pre-lab Exercises
Go through online videos, demonstrating the basic debugging techniques. Some useful links are given below:
Debugging with Visual Studio(video)
Announcements
We will have a simple 5 minute quiz at the beginning of the lab on Blackboard. Please sign in to your Blackboard account and finish the quiz individually. To access the quiz, go to CS 141 course on Blackboard, and click on Lab Quizzes, there you can find Lab 6 Quiz. To access the quiz, you will need a password, which will be announced by the TA in the lab
You must work with a single partner, in a group of 2. You must take turns being the “driver” and the “navigator”. (If there are an odd-number of students in the class, your TA will make an adjustment.)
Bring your laptops to work with the IDE of your choice
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.
Set a breakpoint, and run the program until it stops there
Check the values of variable at that point
Single-stepping (step-in & step-over) through a program, starting from a breakpoint
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