in reply to Debug recursion ?

What do you mean by "return from the recursive function"? Do you mean just leave the debugger prompt and resume execution? If so, use "c", not "r".

Replies are listed 'Best First'.
Re^2: Debug recursion ?
by Alien (Monk) on Feb 25, 2007 at 13:17 UTC
    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.
      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 ?