Vai al contenuto

Use Breakpoints With IL and ST Languages

Breakpoints work the same way in both IL and ST languages; in order to set a new break- point, move to the code line where you want to halt the program execution, then choose Debug>Set/Remove breakpoint.At the far left side of the code line, left to the line number, a red circle will appear, mean- ing that there’s a breakpoint on that line. Use Breakpoints With IL and ST Languages-image_0Note that you cannot set breakpoints on every instruction, for example you cannot set a breakpoint on an end_if statement and similar.When a breakpoint is hit (which means that the code execution has reached the line where the breakpoint is set), the whole line is highlighted and a yellow arrow appears inside the red circle, to indicate that the program is waiting to execute that instruction.Also the program execution state will change, in the far bottom-right corner, it will change from running to halted. Use Breakpoints With IL and ST Languages-image_0Note that when a breakpoint is hit, the program execution is halted before that instruc- tion took place.In the following image you can see that if we halt the program execution on an addition instruction, the addition hans not yet took place. Use Breakpoints With IL and ST Languages-image_0Selecting Debug>Run the program execution will be resumed until another breakpoint is hit, or the same breakpoint will be hit again after an entire cicle has took place.Selecting Debug>Step the code line where the program execution has halted, will be executed, but the program will halt on the very next instruction. In other words, the result is the same as setting a new virtual breakpoint to the next instruction and then resume the execution.