MIX Assembler and Simulator |
Sergey Poznyakoff, Douglas Laing |
MIX Manual (split by node): | ? |
The principal purposes of using a debugger are so that you can stop your program before it terminates; or so that, if your program runs into trouble, you can investigate and find out why.
Inside mixsim
a program may stop either because it hit an
active breakpoint or because it reached a new line after NEXT
or STEP
command (see below). Additionally, you can stop a
running program at any moment, by pressing interrupt (usually
C-c).
CONTINUE
C
Continue program execution, at the address where it last stopped.
A typical debugging technique is to set a breakpoint (see section Setting Breakpoints) at the location where a problem is believed to lie, run your program until it stops at that breakpoint, and then step through the suspect area, examining the variables that are interesting, until you see the problem happen.
The following two commands are useful with this technique.
NEXT [count]
N [count]
Execute next instruction and stop again. With an argument, execute next count instructions. If any of the executed instructions is a function call, that function is not descended into.
STEP [count]
S [count]
Execute next instruction and stop again. If the instruction is a function call, descend into that function. With an argument, execute next count instructions.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.