User manual

Basic debugging features UM0036
188/385 Doc ID 7705 Rev 11
Figure 132. Data breakpoints window (EMU2)
Figure 133. Data breakpoints window (DVP and Simulator)
Below, we see the result when the program is run—the first breakpoint reached is when
st0 equals 256.
Note: For the EMU2 emulator and DVP only—When using the Counter and Condition features,
be aware that STVD will stop the running of the application on the emulator each time it
needs to evaluate the counter and/or the condition, which means that the application is not
executing in real time, although it appears to be in Run mode.
5.10 Call stack window
To open the Call Stack window, either click on the Call Stack window icon in the View
toolbar or from the main menu select View>Call Stack.
The Call Stack window shows the function calls stored on the microcontroller’s Call Stack
from the most recent function call, traced back to the earliest call. For example, the Program
Counter is always placed at the most recent entry in the Call Stack window (#0).
The stack keeps track of all the variables and parameters local to the part of the program
where the function call is made at the moment of the function call.
If an entry in the call stack is selected and double-clicked, the source code corresponding to
that address appears highlighted in the Editor window. Program variables and parameters
are shown in the Local Variables window with the values they had when the function call
was made.
Being able to move backwards in the stack permits program states corresponding to specific
entries in the call stack to be examined in detail without moving the Program Counter.
For example, Figure 134 shows a snapshot of the program at the current Program Counter
position. The Local Variables window shows the value of the parameter “i”, and the location
of the PC is shown both in terms of the instruction line in the Editor window, and in terms of
the address in the Disassembly window.