ILE C/C++ Programmer's Guide

Setting Conditional Breakpoints for a Macro

To set a breakpoint on the first statement of a multi-statement macro, position the cursor on the line containing the macro invocation, not the macro expansion.

Example:

This example shows you how to set a conditional breakpoint using F13 (Work with module breakpoints).

  1. To work with a module, enter DSPMODSRC. The Display Module Source display is shown.
  2. To display the module source that you want to modify, type display module name, where name is the file name of the module you want to modify, and press Enter.
  3. For each conditional breakpoint you want to set:
    1. Place the cursor on the line that should follow the new breakpoint.
    2. Press F13 (Work with module breakpoints). The Work with Module Breakpoints display appears.
    3. Place the cursor on the first line of the list, type 1 (Add), and press Enter.
      For example, to set a conditional breakpoint at line 35 when i is equal to 21:
      1. In the Line type, enter 35.
      2. In the Condition field, type i==21.
      3. Press Enter
      Note:
      If you do not want to switch panels, you can set the same breakpoint from the Display Module Source command line by typing:

      break 35 when i==21

      A conditional breakpoint is set on line 35.

      +--------------------------------------------------------------------------------+
      |                          Work with Module Breakpoints                          |
      |                                                             System:   TORASD80 |
      | Program  . . . :   T1520PG1              Library  . . . :   MYLIB              |
      |   Module . . . :     T1520IC2            Type . . . . . :   *PGM               |
      | Type options, press Enter.                                                     |
      |   1=Add   4=Clear                                                              |
      | Opt     Line       Condition                                                   |
      |  1      35     i==21                                                           |
      |  _      50                                                                     |
      +--------------------------------------------------------------------------------+
      Note:
      An existing breakpoint is always replaced by a new breakpoint entered at the same location.
  4. After all breakpoints are set:
    1. Press F12 (Cancel) to leave the Work with Module Breakpoints display.
    2. Press F3 (End Program) to leave the ILE source debugger. Your breakpoints are not removed.


[ Top of Page | Previous Page | Next Page | Table of Contents ]