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

3 Using the Cecil Debugger

3.5 eval from the debugger

If you are debugging a program that includes the Cecil evaluator (such as any program compiled with the full standard library), then any input that is not recognized as a debugger command is evaluated in the context of the current active stack frame. For example, if x is a list of HandlerTaskRec, you could find all the tasks of priority >2000 that are currently elements of x by doing the following:

debug> x.do(&(y){ if (y.priority > 2000, { y.print_line; }); })
If the result of evaluation is non-void, then the print_string message is sent to the result to compute a user-defined printable representation of the result.

In addition to typing single expressions to be evaluated, you can also type eval at the debug> prompt and drop into an evaluator environment frame, which gives you the full power of the evaluator, including the ability to define local variables and add methods to the program. However, once you type ctrl-D and exit the evaluator environment, any variables defined in the evaluator disappear. (Variable declarations entered at the debug> prompt are forgotten at the next debug> prompt.)

Section 4 discusses the evaluator in more detail.


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