5.10.8. Setting conditional breakpoints

Use the Set Address/Data Breakpoint dialog box to set a conditional breakpoint:

  1. Select Target ? Reload Image to Target to reload the image.

  2. Select File ? Open... and open the source file dhry_2.c so that it is displayed in the File Editor pane.

  3. Scroll through the source file dhry_2.c and locate the line:


    81 }/* Proc_7 */

  4. Right-click on the line number and select Set Break... from the context menu to display the Set Address/Data Breakpoint dialog box shown in Figure 5.5.

    If the line number is not visible, then right-click inside the gray area at the left of the required statement or on the line of code to display the context menu.

    Note

    Ensure that you select Set Break... from the context menu. If you select Set Break, the Set Address/Data Breakpoint dialog box dialog box is not displayed and the breakpoint is set automatically.

    Figure 5.5. Set Address/Data Breakpoint dialog box

    Set Address/Data Breakpoint dialog box

    In this dialog box:

    • The Location field is prefilled (but you can change this if required).

    • The Class field shows the default breakpoint supported by your debug target (a Standard breakpoint). You cannot change this.

      The contents of this field change depending on your debugging environment and target configuration, see RealView Debugger v1.8 User Guide for details.

    • By default, a software instruction breakpoint is highlighted. The available breakpoint types are defined by your debug target. For connections that use RVISS, you can choose from a range of supported breakpoint types.

    • For certain breakpoint types, the Location, Value Match or Class fields might be unavailable. In this case, the field is grayed out and right-click menus are disabled.

  5. Modify the Location field to the value \DHRY_2\#81:6, as shown in Figure 5.5.

  6. Click New to specify the Qualifiers or conditions for the new breakpoint. This displays the New Qualifiers menu.

  7. Select When Expression True... from the menu.

  8. Enter the condition Int_Glob==5 in the prompt.

    RealView Debugger requires that you enter the condition in C format.

  9. Click Set to confirm the entry and close the prompt box.

    The breakpoint condition is shown in the Qualifiers group display.

  10. Click OK to close the Set Address/Data Breakpoint dialog box.

    The code view is updated and a yellow disc appears to show that you have set a conditional breakpoint. The Cmd tab, in the Output pane, shows the RealView Debugger command used to set the breakpoint.

    Because the breakpoint location is in RAM, RealView Debugger sets a conditional software breakpoint.

  11. Click the Run button on the toolbar to execute the image, and enter 20000 at the prompt.

    When the breakpoint is reached, execution stops and RealView Debugger displays a message in the Cmd tab of the Output pane to identify the point in the source code where the program stopped.

    The next section, Managing breakpoints, describes how to display the breakpoint details, and other useful tasks.

If you try to set a breakpoint on a non-executable line, RealView Debugger looks for the first executable line immediately following and places the breakpoint there. If the lines preceding the breakpointed instruction are comments, declarations, or other non-executable code, they are marked with gray, downward pointing arrows. Lines marked in this way are regarded as part of the breakpoint. You cannot place two unconditional breakpoints on the same line, or on lines marked by the downward pointing arrows.

For full details on using the Set Address/Data Breakpoint dialog box to specify your breakpoints, see the chapter that describes working with breakpoints in RealView Debugger v1.8 User Guide.

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0181G
Non-Confidential