User manual

Basic debugging features UM0036
184/385 Doc ID 7705 Rev 11
5.8.2 Viewing the instruction breakpoints
To open the Instruction Breakpoints window, either click on the Instruction Breakpoints
window icon in the View toolbar or from the main menu select View>Instruction
Breakpoints.
Figure 129. Instruction breakpoints window
When a breakpoint is positioned, its specification appears in the Instruction Breakpoints
window. From here, the breakpoint may be disabled/enabled or removed.
In addition, breakpoint counters and breakpoint conditions may be set in this window
(double-click in the Counter or the Condition column to open a box for value entry).
The Instruction Breakpoints window contains three fields:
Location: Information on the breakpoint location, plus an icon indicating the breakpoint
is active/inactive.
Counter: A counter may be set in this field, to be decremented each time the
Breakpoint Condition is TRUE when the breakpoint position is passed during program
execution. (If there is no condition, TRUE is returned at each pass of the breakpoint.)
When the counter reaches zero, the program will stop at the subsequent pass:
–With no condition set, and counter = n, the program will stop on the (n+1)
th
iteration.
–With condition set and counter = n, the program will stop after the breakpoint is
passed and its condition is found to be true n times.
Condition: Breakpoint conditions may be set in this field. A condition is a C expression
which returns a Boolean value. For example: (i == 28) && (j> = 0xC0).
Note: For the EMU2 emulator and DVP versions 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. If the evaluation returns
the Boolean value FALSE, execution is resumed after a brief suspension.
5.8.3 Setting counters and conditions
If a breakpoint depends on a counter and a condition together, the condition is first taken
into account and secondly the counter. The counter is only decremented when the
condition is TRUE.
For example, consider debugging the following function:
void f(int i) {x += i;}