Creating Conditional Breakpoint Examples

Here are some examples of conditional breakpoints code:

  • To define a breakpoint that is reached whenever variable i is greater than 20 but less than 25:

        if (i > 20 && i < 25)
            $stop;

  • To define a breakpoint that will stop execution every 10th time that TotalView executes the $count statement:

        $count 10

  • To define a breakpoint with a more complex expression, consider:

        $count i * 2

    When the variable i equals 4, the process stops the 8th time it executes the $count statement. After the process stops, the expression is reevaluated. If i now equals 5, the next stop occurs after the process executes the $count statement 10 more times.

For complete descriptions of the $stop and $count statements, refer to Built-In Statements.

 
 
 
 
support@etnus.com
Copyright © 2001, Etnus, LLC. All rights reserved.
Version 5.0