in reply to Re: Debug recursion ?
in thread Debug recursion ?

I don't know how to make this any clearer. Assume this general example : you debug code and the code reaches a subroutine call. Next the debugger enters the subroutine code , and shows you the subroutine body , one instruction/statement at a time. If you don't want to go through the subroutine , you can press r , and the code continues it's execution after the subroutine call. That's the same thing I need help with the deep recursion subroutine call.

Replies are listed 'Best First'.
Re^3: Debug recursion ?
by ysth (Canon) on Feb 25, 2007 at 18:29 UTC
    If you don't want to go through the subroutine , you can press r , and the code continues it's execution after the subroutine call.
    I'm not sure if you are confused in how you are presenting it or confused in your understanding. r makes the code resume execution right where it was, but without the debugger in single-step mode, reverting to single-step mode in the current function's caller. Or that's what it's supposed to do; as you noticed, it doesn't seem to work correctly when the debugger breaks with "100 levels deep...".

    You've tried to clarify what r does; but I was asking for more information about what you are trying to do.

    Try removing any function calls from your return statements; in your example, make it

    $n *= fact($n-1); return $n;
    (without doing this, r doesn't do anything helpful, even without the deep calls) then use r repeatedly until you are out of dumvar:: and back into your code.
      And I should press r 100 times ( in a recursive subroutine case )? Isn't there a better way ?
        So you want to get out of all the levels of recursion? Set a breakpoint just after the initial call to the recursive subroutine (in your "c 10" example, there's already one there) and use c.