Halting on a line in C++ only if a condition is true
Often a particular part of your program works fine for the first
few thousand times, but fails under certain conditions. You don't
want to set a simple line breakpoint because you will have to keep
entering GO
.
Example: sample C++ program for debugging
For example, in
main
you want to stop in T_DIVIDE
only
if the divisor is 0 (before the exception occurs). Set the breakpoint
like this: AT 40 { if(num2 != 0) GO; }
Line
40 is the statement labeled CALC2 . The
command causes z/OS® Debugger to stop
at line 40. If the value of num
is not 0, the program
will continue. z/OS Debugger stops
on line 40 only if num2
is 0.