How to Use the Vortex Compiler
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.