








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









Using the Debugger
Seemingly Spontaneous Without a doubt, you'll come across this lovely pink box as you're develping in Squeak:
This is the debugger tool, which is useful for finding and fixing bugs in your code. This is also one of the most common error messsages you will come across: "does not understand"/"message not understood". Basically, it's saying that the message/method that was called does not exist. Often, the bug won't be directly in your code, but might show up as if it were a bug in some code that has already been written. Usually, it's still a bug in your code, though.
There are many system messages that are called with your code, so it takes some patience to find exactly how data is moving through Squeak! One of the most important things to note about Squeak is that you can write code in the debugger, because it is a late- binding language.
Do-it-Yourself Need to bring up the debugger yourself? Just add self halt. into your code:
It will bring up the debugger for you!
Click on the "Debug" button to open up the main debugging window (below). This allows you to view the current state of your object while the program is paused. Here, in the circled area, there is an instance variable called "name", which has been set as "Dude" (you can make changes to your object, so I could rename this object "Dudette" if I wanted to). The area at the top shows the call-stack, so you can see a list of which methods are calling other methods. To the right of the instance variables (circled) is the actual data passed into the method that is selected in the call-stack.
If this format of debugger is not self-explanatory, the user can double click on any line and this takes the programmer to the source code (to the exact line) where the bug is. The debugger highlights the point of error in color green as in figure 2.
figure2.
Here the Developer can fix and modify the code while in debugger view and save his changes to the source code. If the developer is still not able to find the point of error, he can traverse through the list of variables (in the third row of debugger) and see if the values are correct. Since everything is an object in Squeak, each variable should have some definte value. This utility (looking at object values) also helps developer in the debugging process. For instance in figure 2., developer can trace the value of buzzMorph, that it is 'nil' and from the debugger view can figure that it is not able to load the image 'buzz.gif' (It is very possible that the file is missing!).
A simple example where DEBUGGER helped during milestone 5.
In our script studio, in the beginning, we did not consider the scenario where user would try to upload a file and select 'CANCEL' i.e not select any file from the file selection menu (figure 3). The contents of the selected filestream were published in the script studio (where user could modify the contents of animation script) but in this scenario our code would attempt to extract the contents of 'NIL' file and that gave an error. The debugger highlights the error (line) in figure 4.
figure 3.
of storage. This should be enough for our projects.
Once you have an FTP, start in the Monticello Browser.
Add a Package to version control by doing +Package, be sure the type the name EXACTLY like it is in your package list.
With that package selected, click +Repository - select FTP.
rename each of the string entries to match with your FTP host - URL to get to the ftp, I used 'ftp.mindspring,com' directory - the directory in the ftp to use for monticello user - FTP username password - FTP password
once that is done you can now all code to the repo and also open the repo.
To add code, on the monticello browser, select both the project and repo you wish to use and click Save.
When successful, a message entry window will appear allowing you to enter a message about this submission.
By instead clicking Open, a list of submissions will be displayed on a new window. These submissions are in the form -..mcz By highlighting any one of these, you can check the message associated with that submission.
Using the Changes button opens a window listing all changes on the top half by class and message. Once one of these is selected, a code window will appear. Common text remains black, while deleted text has a blue strikethrough and red text signifies new code. (All relate to the current state of your code)
Click the Load button to HARMFULLY REPLACE AND REMOVE all local code with code in the submission, note the REPLACE AND REMOVE.
Diff may be used to compare the current selection with a previous one by the same coder to generate just the changes between them.
History lists all comments of submissions taken before a highlighted project.
Merge lets you select which changes you want to take, as opposed to Load.
If you ever get an error with a once-working FTP using Monticello, relax and try in the future, possibly close and reopen the monticello windows.
Using Finding Tools
Each of the tools for finding methods and implementors inside Squeak were very valuable to our group during our project considering they often represented the most efficient ways for us to find classes or methods we needed.
The implementors of... tool was useful in situations where we were using the Kernel classes and came across methods we didn't recognize. By clicking on Implementors and
How do we use the SimpleChangeSorter and the DualChangeSorter to manage change sets?
SimpleChangeSorter The SimpleChangeSorter lets us look at the list of the change sets in the current system. As we can see in the image bellow the listo f all the change sets are in the top left hand corner of the browser, and list of classes that are changed are in the top right hand corner of the file. The methods in the change sets of those classes is listed in the second row of the window. and the last row shows the code of those classes. So the user can look at the SimpleChangeSorter and change the code of the file. also with right clicking (yellow-click) on the change sets the user can create new change sets.
DualChangeSorter DualChangeSorter is basically the same as SimpleChangeSorter, but it has two of the same browsers attacked to each other side by side as you can see in the screen shot down here. Every thing that can be done in SimpleChangeSorter can be also done in DualChangeSorter. However in DualChangeSorter we can compare two different change sets, and look at them at once. we can merge two change sets in DualChangeSorter, or we can also take the changes that are in both cs file out from one, basically we can subtract the changes.
Why should I used Change Sets:
Using change set is quite easy to do in Squeak, and it is also highly recommended. Take it from me, our group did most of the work on our project by manually filing out the specific classes and methods in the classes that we worked on. By using change sets we could have let Squeak do all the heavy lifting and memory of what changed in the image. There are some positives and negatives (things you should watch out for) when using change sets to integrate code.
Positives:
Negatives:
How to use Change Sets:
o
o
o o This allows you to manipulate the changes from one set to another
o Move/copy changes from one change set to another o Merge changes from one side to the other (deleting to originating side) o Subtract the other side from the seleceted change set (opposite of copying)
There are many more features that are offered to the user by change sets, however I cannot cover them all. Hopefully this will give you a jump start on change sets and allow you to use them to their full potential. The best way to learn is to explore the change sorters and try out some of the more advanced features.