Debugs program in virtual machine with given program-arguments. Currently programs can be debugged only by interpreting the intermediate instructions in virtual machine, not in native mode.
When the debugger starts, the debugger shell is run. The shell prints the intermediate instructions, and also corresponding source code lines in green.
For example, the following command starts debugging of the dc.cminora program:
To obtain help, use the help command, or just give 'h' ENTER:
Debugging is automatically started when the debugger shell is run, but to start the debugging again after program is exited for example, use the following command:
To end the debugging session, give the exit command:
To run the program to the next breakpoint or to the end if no breakpoints have been set, use the run commmand:
To single-step the program by executing the next intermediate instruction, use the step command:
The single-stepping goes into the called functions. To step over called functions, use the next command:
To print a stack trace, use the stack command:
To print the value of a variable that is in the current scope, use the print command:
To print the value of a n'th local variable or parameter, use the local command:
The first parameter is local number 0, second parmeter local number 1, etc.. Local variables have the next indeces after the parameters.
To print the value of n'th value in the operand stack, use the operand command:
The value on top of the stack is number 0, the next operand below it is number 1, etc.
To print value of allocation number <n>, use the allocation command:
To print value of field number <n> of an object number <m>, or element <n> of array number <m>, use the field command:
To list next 10 source code lines of source file <f> starting from line <n>, use the list command:
To set a breakpoint at line <n> of source file <f>, use the break command:
To clear a breakpoint number <n>, use the clear command:
To show the breakpoints, use the show breakpoints command:
To repeat latest command, just press ENTER.