| |||
| Home > Working with Breakpoints > Setting conditional breakpoints > Using the Simple Break if X, when Y is True dialog box | |||
The Simple Break if X, when Y is True dialog box, shown in Figure 5.12, enables you to set a conditional breakpoint that specifies an expression (given in C format). The result must be True when execution arrives at the specified address for the breakpoint to be triggered. This dialog box provides a quick way of assigning the When Expression True qualifier to a breakpoint (see Specifying Qualifiers).
To display the Simple Break if X, when Y is True dialog box (see Figure 5.12) use one of the following methods:
Select the following option from the Code window main menu:
Debug → Breakpoints → Conditional → Break if X, when Y is True...
Right-click on the margin, an instruction, or line of source code in the File Editor pane, and select Set BreakIf... from the context menu. Then select Break if X, when Y is True... from the List Selection dialog box, and click OK.
Using the Break/Tracepoints pane, either:
select Set BreakIf... from the Pane menu
right-click on the pane background, and select Set BreakIf... from the context menu.
Then select Break if X, when Y is True... from the List Selection dialog box, and click OK.
Right-click on a value shown in the Watch pane, or on a variable shown in the Call Stack pane, and select BreakIf... from the context menu. Then select Break if X, when Y is True... from the List Selection dialog box, and click OK.
The Simple Break if X, when Y is True dialog box (see Figure 5.12) contains the following fields:
Choose the type of breakpoint that you want to set. The options are:
SW Instr
HW Instr
HW Access
HW Read
HW Write.
Specify the location where the breakpoint is to be set. This can be:
a specific line number in the source code, with or without a module name prefix (see Qualifying breakpoint line number references with module names)
a specific address or address range (see Specifying address ranges)
a function entry (see Specifying the entry point to a function).
The breakpoint unit triggers if the PC equals the corresponding
address, or falls within the specified address range. For example, Proc_3.
The expression to test. This must give a True or
False value as the result, or example, Run_Index==10.
You can enter values directly in these fields, or you can click the drop-down arrow to the right of the fields to choose from a list browser (see List browser dialog boxes), select from your personal Favorites List (see Favorites categories used by RealView Debugger features), or select from a list of previously-used expressions.