Lab2: Debugging


Lab #2: Introducing the Debugger


Objectives: The objective of this assignment is introduce you to the Smalltalk debugger.
Upon completion, you should be able to:

You will also be familiar with various Squeak/Smalltalk windows

Starting the lab:

If all went well in the first lab, you can start Squeak by double-clicking on your personal image in your H:.
If Windows prompts you for a program to open the filename.image with you can specify S:appssqueaksqueak.

Improving Code FileOut

You will need to modify your squeak image in order to turn in your labs from now on.

You will need to "file in" the Squeak file CrLfFileStream.cs into your Squeak directory. Save the file (To do this, right-click on the link to save the file in your directory) and open Squeak. Next, right click on the Squeak desktop and select open..., open file list. Highlight the CrLfFileStream.cs file in your directory and right click on it. Select the fileIn option from the menu. At this point you should have successfully filed in a file into Squeak.

Next, open up the System browser and search for the class FileStream. (Choose Find Class from the categories list menu.) Select the Class button on the browser and select the "concrete classes" protocol. Click on the concreteStream method so that it appears in the text pane. Change the StandardFileStream text to CrLfFileStream and accept the changes. This will modify your squeak image to "file out" more readable code files.

Procedure:

File in the code to be debugged: DebugLab.st Follow the instructions above on how to save and filein a file.

Open the debugger tutorial web page for this lab.

The code that you will run is executed by typing:
AccountList example1

in the workspace and "do it".

Look at the code example1 (hint: It's a class method!) and try to figure out what it is supposed to do. Examination and manipulation of the values in the example should give you some hints about the problems with the Account operations. The simple workspace code at the end of the web tutorial might also be useful.

Use the debugger to track down the logical errors in the Account class. Fix them.

Notes
The comment for the Account class specifies that:

The AccountList class contains no errors because Dictionaries and collections have no been covered in lecture yet. We have added a printString method to print the accounts.

You are free to create additional code to test the Accounts. If you want us to see this code (i.e., you want to get some credit and are pretty lost), make it a class method of Account called example, and include comments liberally.

After debugging all logical errors, executing AccountList example1 should output:

Finishing the lab:

After you have completed debugging your code, fileout all the code using the same steps as in Lab1.

Open up the code in a text editor of your choice. (You can use Squeak for this, too!) Highlight all the text and copy it. You can find most commands in the Edit menu of most text editors.

You can now Turnin your code by going to http://minnow.cc.gatech.edu/cs2390w98x.
Substitute your section letter, in lowercase, for the x at the end of the URL. For example, http://minnow.cc.gatech.edu/cs2390w98a for section a, http://minnow.cc.gatech.edu/cs2390w98b for section b, etc.

You will be prompted for a user name and password. Your user name is your name as it appears on the CS2390 Home page. Your password is your 9-digit social security or student ID number WITHOUT DASHES!.

Click on the Turnin new project link. Select Lab2 in the Assignment menu.

You will now paste the code into the text area of the turnin web page. Click on the Turnin button and you are done!


News Page | CS2390 Win'98 Home Page | CS2390 CoWeb | STABLE | BOOST
Questions/comments/concerns to guzdial@cc.gatech.edu
Page last updated 2/11/98; 9:36:07 AM