InstructionsThe Object Debugger is a new language level inside DrScheme. It provides the same environment as the PLT Graphical language, but with an instrumented version of the class library. Running the DebuggerTo use the Object Debugger, load any program that runs in the PLT Graphical language. Switch to the Object Debugger language. Run the program. DrScheme opens an Object Debugger window for the execution of the program. Debugging ModulesThe Object Debugger can debug programs with multiple modules, but only if the modules use the instrumented bindings for the class library. To debug a module with the Object Debugger, replace all references to (lib "class.ss") with (lib "class-traced.ss"). Using the DebuggerFor now, the Debugger produces a static image representing the execution of (object-oriented portions of) a program. Users may examine the image by scrolling around using the scrollbars on the top and left, or by clicking and dragging the main bottom-right pane. Users may also double-click the object names on the left of the display to scroll to that object. The image is available while the program executes. To add actions executed since the image was generated, users may press the Update button in the top-left. The Filter button opens up a separate window containing the class hierarchy of instantiated objects. Each class can be set to on, auto, or off. The Done button closes the window and applies the filter. Any actions involving only turned-off classes are removed. Classes set to auto use their parent's setting. Interpreting the DebuggerThe Object Debugger window has four primary components. It has a control panel in the upper left. It has an object panel in the upper right. It has an action panel in the lower left. It has an execution panel in the lower right. The control panel contains the Update button, which redraws the other panels to include new actions. It also contains the total count of objects and actions in the current image. The object panel contains the name and class name of each object encountered so far in the execution. The action panel contains a line for each action in the execution, including the name of the source and target object of the action and the name of the kind of action. Actions include new (object creation), get (field access), set (field update), call (method invocation), return (method completion), and The execution panel shows the full image of the program's execution. It contains a lifeline for each object, vertically aligned under its header in the object panel. It contains an arrow for each action, horizontally aligned to the right of its line in the action panel. Action arrows are labeled with the kind of action and the arguments to the action. Both lifelines and action arrows are highlighted to show where control passes from one object to another. Some actions pass control and others do not. |