Using Conditional Breakpoints and Pass Counts

The Breakpoints window in the Debugger includes:

The dialog can be resized.

To specify options for the selected breakpoint

  1. Right‑click on a selected breakpoint in the Breakpoints window.

  2. From the popup menu that is then displayed, select the Options command.

    The Breakpoint Options dialog, shown in the following image, is then displayed.

  3. Check the Enabled check box if you want to disable the current breakpoint. (Conversely, if the selected breakpoint is currently disabled, check the Enabled check box to enable that breakpoint.)

    The Jade Debugger never halts execution at a disabled breakpoint.

    Enabled breakpoints are displayed in the first column of the Breakpoints window with a red circle and disabled breakpoints with a white circle. Clicking on a red circle removes the breakpoint; clicking on a white circle enables a disabled breakpoint.

  4. In the Condition control, specify a condition that you want evaluated, if required.

    A condition can be:

    • Any Boolean expression; for example, "a > b", where "a" and "b" are defined in the scope of the receiving method.

    • One or more if instructions that specify a return value of true or false; for example:

      if indx = 13 then
          return true;
      elseif indx = 1 and cust.number = 345 then
          return true;
      else
          return false;
      endif;
      

      This condition must begin with the conditional if instruction; the final semicolon (;) of an expression is optional.

    The Condition control allows for multiple‑line input. In addition, the Condition control box also provides AutoComplete functionality. If AutoComplete functionality is enabled, you are provided with the usual prompts when the text is entered. The local parameters, local variables, and local constants for the method in which the breakpoint is defined are pre‑loaded in AutoComplete for the entry of the condition. The condition logic expects a Boolean return value.

    Jade constructs a transient method that is essentially as follows.

    m1(): Boolean;
    vars
        local-variable-and-parameters
    begin
        load-locals-entities-with-values-from-the-actual-method-being-debugged
        return expression;  // for case 1 in the above list
        expression;         // for case 2 in the above list
    end;

    The condition source is validated when it is entered. If the enclosing method is subsequently recompiled, the breakpoint is marked for revalidation the next time it is encountered. If it is found to be invalid, the Debugger stops execution at the breakpoint and disables it.

  5. In the Pass count text box, specify the number of times that the breakpoint is passed (that is, the number of times a specific statement is executed) before execution halts, if required.

    The pass count is decremented each time the breakpoint is reached and the Debugger stops when the count reaches zero (0).

  6. Click the OK button. Your breakpoint options are saved if the Save Breakpoints check box is enabled in the Exit sheet of the Preferences dialog (accessed from the Options menu Preferences command). Alternatively, click the Cancel button to abandon your selections.

Breakpoint options (for example, disabling a breakpoint or specifying and changing conditions) can be specified or changed by using the Jade Debugger or the editor pane of the Jade Platform development environment.