User manual

Basic debugging features UM0036
168/385 Doc ID 7705 Rev 11
The commands Go To PC, Run to Cursor and Set PC are also available in the Editor
contextual menu for ease of access when using the Editor during debugging.
5.3.2 Stepping modes
For the Step Over and Step Into commands, you can choose one of two modes of
execution. To change the modes, select Debug Instrument>Stepping Mode, the resulting
dialog box will allow you to select either:
Enter Interrupts When Stepping Into: This is the default mode. In this mode, STVD
uses the debug instrument’s primitive single step to execute one assembler step at a
time. When Stepping Into, STVD will stop at the entry of any interrupts that occur
during the stepping process.
Don’t Enter Interrupts When Stepping Into: In this mode, to step through a single
assembler instruction, STVD sets an instruction breakpoint on the next instruction to be
executed if no interrupt occurs. It then runs the application up to this breakpoint. When
Stepping Into, STVD will not stop at any interrupts that occur during this stepping
process, unless you have placed a breakpoint there prior to executing the step
command.
Limitations:
Cannot handle an instruction that jumps to itself only once. In this case, the
instruction is executed again and again. As a result stepping into or over such an
instruction (Step Into ASM or Step Over ASM) does not work as expected.
Step Over:
To avoid single-stepping through functions that are not relevant to the debug operation.
When a function call occurs, the command Step Over will cause the program to execute the
function, update the program data displayed by STVD and stop at the next instruction line in
the main program. This avoids having to single-step line by line through a function call which
is not of current interest (for example already debugged).
Step Into:
This command single-steps each time it is employed, so at a function call it will single step
line by line through the function which has been called. It is equivalent to, and replaces, a
Single Step command.
Step Out:
When used inside a function, the Step Out command runs the executable to the point of
return from the function call and then updates program data.
In all three cases, the program data is updated to reflect the new PC location after execution
of the step command. This corresponds to the values which would exist at that PC location if
the program were running normally.
Run to Cursor
This command runs the program from the current Program Counter location to the
executable code corresponding to the cursor's current position in the program text. If a
breakpoint is encountered before the cursor position, the execution stops at the breakpoint,
but if restarted will not stop at the cursor position unless this option is again selected.
Set PC
Set a new value for the Program Counter: move PC from its current location to a new
location. This is done without running the program (unlike the Run to Cursor command,
described above). Debug actions can then be carried out with the new PC value.
Table 60. Debug menu run commands (continued)
Command Description