[Next] [Previous] [Up] [Top]

3 Using the Cecil Debugger

3.1 display, display dyn, where

Typing display at the debug> prompt displays a view of the program stack, similar to typing where in gdb or dbx (where is available as a synonym for display). The default display option is to display the lexical chain, which is a subset of the dynamic chain. Since all control structures in Cecil are user-defined, you rarely want to see the complete (dynamic) chain of stack frames. The lexical chain is intended to hide most of the stack frames that are introduced by user-defined control structures. The lexical chain is built by starting at the top-most stack frame and tracing up the program's stack. If the current stack frame is a closure stack frame, then its lexical parent is the next stack frame displayed. If the current stack frame is a method stack frame, then its dynamic parent is displayed next. We build the lexical chain by applying these rules to select which stack frames from the current program stack should be displayed. You can see the complete dynamic chain by typing display dyn at the debug> prompt.

For example,

debug> display
Lexical call stack:
#16 run_richards (count: 1), richards.cecil:397
#14 eval ({...}) in run_richards, richards.cecil:398
#10 eval ({...},
          i: 0) in run_richards, richards.cecil:399
# 9 richards (), richards.cecil:290
# 8 schedule (), richards.cecil:<unknown line>
# 4 eval ({...}) in schedule, richards.cecil:304
# 2 eval ({...}) in schedule, richards.cecil:309
# 1 runTask (tcb: <anon/DeviceTaskRec/: 0x183f55>), richards.cecil:126
# 0 run (t: <anon/DeviceTaskRec/: 0x183f55>,
         work: <anon/Packet/: 0x15e859>), richards.cecil:153
debug>
debug> display dyn
Dynamic call stack:
#16 run_richards (count: 1), richards.cecil:397
#15 time (closure: <closure 0x171011>), system.cecil:72
#14 eval ({...}) in run_richards, richards.cecil:398
#13 do (count: 1,
        c: <closure 0x171009>), small_int.cecil:<unknown line>
#12 loop (c: DelayedComputation), closure.cecil:351
#11 eval ({...}) in do, small_int.cecil:353
#10 eval ({...},
          i: 0) in run_richards, richards.cecil:399
# 9 richards (), richards.cecil:290
# 8 schedule (), richards.cecil:<unknown line>
# 7 while_true (cond: DelayedComputation,
                c: DelayedComputation), closure.cecil:<unknown line>
# 6 loop (c: DelayedComputation), closure.cecil:19
# 5 eval ({...}) in while_true, closure.cecil:<unknown line>
# 4 eval ({...}) in schedule, richards.cecil:304
# 3 if (_anon_0: false,
        tc: DelayedComputation,
        fc: DelayedComputation), boolean.cecil:<unknown line>
# 2 eval ({...}) in schedule, richards.cecil:309
# 1 runTask (tcb: <anon/DeviceTaskRec/: 0x183f55>), richards.cecil:126
# 0 run (t: <anon/DeviceTaskRec/: 0x183f55>,
         work: <anon/Packet/: 0x15e859>), richards.cecil:153
debug> 
Each stack frame is numbered, with #0 being the most recent (topmost) stack frame. Each stack frame shows the method invoked for that stack frame (methods named eval are often the bodies of closures), the names and values of the formal parameters of the method, the lexically-enclosing method (in the case of closure eval methods), and the file name and line number where execution is suspended.

display prints out a short description of each stack frame. To see a fuller description, including local variable values, use the show [n] command to display frame n:

debug> show 15
#15 time (closure: <closure 0x171011>), system.cecil:72
  Locals: start: 900,
          end: Uninitialized
debug> 
show by itself shows the current frame; entering a blank line acts like show.

In the presence of optimization, some line numbers are not available, but all stack frames, even those inlined away through optimization, appear in the stack trace. Also, optimization can cause certain values to not be computed. In particular, often closures are inlined away; their values print out as DelayedComputation in the stack trace. Finally, some variables may not be initialized at the point the stack trace is printed, and these variables print out as Uninitialized.


How to Use the Vortex Compiler - 20 JAN 97
[Next] [Previous] [Up] [Top]