The debugger opens automatically when errors occur, or you can open the debugger at any point in your script by inserting a breakpoint instruction in the script. The breakpoint instruction is the halt message, which every object understands.You can use the Break menu option available in many code browsers to add a breakpoint:You cannot insert a breakpoint in a Doit method. Nor can you set a breakpoint on entry to a primitive method; however, breakpoints are supported in primitive fail code.
3.
4. In the Configure Breakpoints window displayed, specify constraints on the breakpoint. One Shot specifies if the breakpoint should remove itself after the first time it is triggered. Stop in process defines the processes in which the breakpoint should fire. Stop at iteration defines how often many times a breakpoint can be hit in a process before the breakpoint fires. Stop when true defines a Smalltalk expression that causes a breakpoint to fire if it evaluates to true; the expression can use local and temporary variables.For most breakpoints, you will likely want to take the defaults of false for one shot, <all> for the process and iteration constraints and true for the expression constraint.
5. Select OK.To remove a breakpoint, change the method description and save the changes or select Configure Breakpoint from the Breakpoints menu. To clear all breakpoints, select Clear Method Breakpoints from the Breakpoints menu.For more information on breakpoints, refer to "Debugging code" in the VA Smalltalk User's Guide.To add breakpoints to methods in your applications, it is best to use menu options. When you are evaluating code in a Workspace, however, you cannot add a breakpoint using a menu option. You must add the statement self halt to your code to create a breakpoint.Place the statement before the code that you are inspecting. For example, as to the code in Examining objects, to inspect the printing of the ordered collection's size, you place self halt before the last line:Or, you can send the halt message as a cascaded message:You can set a conditional breakpoint by adding a self halt statement inside an ifTrue: or other conditional block.When you run the application or code containing self halt, a debugger resembling the following appears:To remove the breakpoint, simply delete the self halt statement and your script will work as it did before.You can make corrections in any script, select Save from the pop-up menu, and resume execution by selecting the Resume push button.Displays the source of the script that is sent next. It takes you into other scripts and objects.Executes the script that is sent next without showing its source. It skips over the messages used to the next message in the script.Skips to the end of the current script, and stops only on a return (^) statement.After examining the code, you might have noticed the flaw in the code defining an ordered collection. The method yourself should be sent to the ordered collection after it is defined:
![]() |