How to use zb to debug


I want to monitor some variables in my program.

So I do this "zb *varname", however, i don't really want to get break went the program touch "varname" every time.

I only want to get break when certain conditions are meet. For example, $d(varname(1,2,3)) >  0, then break.

Is there any way to achieve this?


  • 0
  • 0
  • 88
  • 0
  • 2


zb *varname::"$d(varname(1,2,3,))>0"


You want to use the condition parameter of zbreak. Take a look at this code:

x(1,2,3) = -2
x(1,2,3) = 1
x(1,2,3) = 3


If I do the following with zbreak:

zb *x:"B":"$g(x(1,2,3))>0"

This just breaks if x(1,2,3) is greater than 0. Then execute the routine, this is what happens:

%SYS>d ^zTestDebug
 s x(1,2,3) = 1
%SYS 2d0>g
 s x(1,2,3) = 3
%SYS 2d0>g