AppendixA *** DRAFT *** PolleZ, May 5, 1984 6:38:16 pm PDT
APPENDIX A: NAVIGATOR DEBUGGING SESSION
Appendix A

Navigator Debugging Session
The following sample debugging session shows an optimized Cedar program named PTZTest14 being debugged using the prototype implementation of Navigator. The purpose of PTZTest14 is to demonstrate most of the capabilities of the Navigator system in a relatively short, simple program. It does not compute any interesting results. The program contains three inline procedures: even, Tail, and TestInlineProcedure. The procedures even and TestInlineProcedure are each called (and hence expanded) once, from the (noninline) procedure Proc1. Tail is called twice: once from TestInlineProcedure—a nested call—and once from Proc1. The call from Proc1 is further complicated because Tail[4,5], which is called when i is even, expands to the sequence "b4;c5", which can be cross-jumped with the last two statements that execute when i is odd.
These examples were produced on a Dorado [Lampson+80, Pier83], a high-performance personal computer equipped with a large bitmapped display and a mouse pointing device [Thacker+81]. The display's screen area is divided into multiple non-overlapping windows called viewers. The viewer labelled Navigator Commands at the lower right contains a command menu for the Navigator debugger. Commands are organized into related command columns; they are designated in the text by command column/command name. A limited amount of user feedback appears in the Navigator Commands viewer. User programs are invoked from the User Executive viewer; debugger commands like Display/Breaks or Show Stack/Top Frame print their results there. The source text of the program being debugged is also on the screen in the ptztest14.mesa viewer. The user sets a breakpoint by selecting one or more source characters and clicking a mouse button over the Breaks/Set command area. The debugger displays the current program location by highlighting an area in the source text when the user clicks the Control/Source command. The commands in the Optimization column (a slight departure from expected behavior) are necessary because the viewer system can only highlight one contiguous screen region at a time.
In the PTZTest14.mesa viewer on the left, the user has clicked a mouse button to select the character "←" in the first statement in the inline procedure Tail.