122 Lab week 8
Labs Start On the Hour
Please arrive at 026 Kla early enough to be seated and do the following:
- start FireFox, login to our Blackboard course site, open
Schedule > Class Calendar
- in the calendar, click the link for the
lab outline for the week
- start SSH, connect to shell.uoregon.edu, & open a File Transfer window
- start Visual C++ & open a project
If you arrive late, your lab instructor will not be able to take time away from the other students to fill you in on what you missed.
Lab Exercise: Visual C++ Debugger
In class, we saw how to insert temporary cout statements into a program to examine the value of variables at runtime. These temporary output statements are used while you are developing the program and then removed after the program is finished and is working correctly. The temporary cout statements are called scaffolding.
In addition to use of scaffolding as a debugging tool, all IDE's (Integrated Development Environments) offer a software utility called a debugger that allows you to set breakpoints in a program and then step your program through its execution from one breakpoint to the next.
Instead of printing the value of a variable with a temporary cout, you use the debugger to directly inspect a variable's value at each breakpoint.
Learn How to Use the Visual C++ Debugger
- Download the C++ source file at chessPence-short.cpp. This file will be used to demonstrate the built-in debugging tools included in the Visual Studio development environment.
- Your lab instructor will demonstrate and explain the features of the Visual C++ Debugger.
- Folllow your lab instructor's directions to practice setting breakpoints in chessPence-short.cpp.
To set a breakpoint, simply click on the grey sidebar to the left of the line of code that you want to break execution on. A red dot should appear.
- Run the program and use the breakpoints to examine variable values during program execution.
- Folllow your lab instructor's directions to use the Step Into, Step Out, and Step Over commands in Visual Studio to control program execution while the debugger is running.
- To gain experience, download the C++ source file at five-six-props-eof-broken.cpp and use the debugger to locate and correct the errors in this program.
/etc
Micro Labs on Campus: In addition to 026 Kla, Visual C++ 2005 Express Edition is installed in 013 Kla and 101 Mck, but it is not installed in other micro labs on campus.
Saving your Lab Work: The My Documents folder on the PCs in 026 Kla is cleared periodically. If you want to save a copy of your lab work, use SSH's File Transfer window to upload your files and/or folders to your shell.uoregon.edu account. Or bring a USB drive with you to your lab and keep your /110 folder stored on that drive.
122 IT Applications/DuckWare CD: Apart from Visual C++, alll the software applications we use in the lab (SSH, FireFox, Fugu, ...) is on the DuckWare CD, and can be installed on your personal computer. The DuckWare CD is available from MicroHelp, 151 McKenzie. See also: OS X applications and Parallels Desktop.
The 122 Learning Environment
At the start of the term, your lab instructor will regularly stop and ask the question, "Can all of you hear me, especially in the back of the room? Can you understand what I am saying?"
It's important that you are able to follow along as the instructor presents material. If you cannot hear or understand what is being said, please raise your hand and say (polite always works) that you are having difficulty following the presentation. The lab instructor will appreciate your assistance.
Also, please keep in mind that your responsibility is to pay attention and follow the instructor's directions. In particular, you should not be reading email, surfing the web, visiting with other students, etc., during the lab. Save those activities for after the lab.