[Next] [Previous] [Top]

How to Use the Vortex Compiler

3 Using the Cecil Debugger

Most features of the Cecil debugger require the application being debugged to have been compiled with debugging support (the debug_support compiler option must have been set to true, which is its default setting). There are three main ways to enter the debugger. First, run-time errors like message-not-understood invoke the debugger in the context of the error. Second, typing ctrl-C interrupts a program compiled with debugging and invokes the debugger (typing ctrl-C kills a program compiled without debugging support). Third, the Cecil breakpoint function inserts an explicit debugger entry point. For example,

	if(x > 5, { breakpoint(); });
invokes the debugger if x is greater than 5 at this point in program execution. In the Vortex source code we often embed breakpoints guarded by compiler integer options into key routines; this allows us to simply set the integer option to a "high" enough level and easily enter the debugger at critical points when debugging that piece of the program. Alternatively, the assert and error functions can be used as defensive programming measures to invoke the debugger whenever unexpected situations arise.

When you first enter the debugger, you will see something like:

Current stack frame:
# 0 run (t: <anon/DeviceTaskRec/: 0x183f55>,
         work: <anon/Packet/: 0x15e859>), richards.cecil:153
debug> 
The stack frame description tells you the method being executed when the debugger was invoked, and the values and types of its formal parameters and local variables. In the example above, we are in the run method which has two arguments and no local variables. Variable work contains an object which is an anonymous (not specifically named) descendant of Packet. If a message-not-understood error invoked the debugger, then the message that was not understood and its arguments appear above the stack frame.

3.1 - display, display dyn, where
3.2 - up, down, goto
3.3 - restart, recover
3.4 - print
3.5 - eval from the debugger
3.6 - Breakpoints
3.7 - Exiting the debugger
3.8 - Help

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