3 Using the Cecil Debugger
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
.
Generated with Harlequin WebMaker