libxapi to only count depth during execution, increment length only during unwind