Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging recursive methods in Eclipse -- any clever way to avoid getting trapped into ever more nested calls?

A common problem I face when debugging recursive methods is that I can't avoid getting trapped into going deeper and deeper into the stack when I want to debug a given piece of code. The only way to avoid getting trapped is to manually disable the BP and then set up it again after the block of code I'm interested in has been passed.

enter image description here

In the above picture, I just want to do a little stroll over the loop's variables for each iteration, seeing if they're behaving as they should and if all's fine and dandy, but I'm currently only getting the first iteration of each call to combinations!

Any clever ideas to get around this?

like image 769
devoured elysium Avatar asked Nov 01 '22 19:11

devoured elysium


1 Answers

Try to use conditional breakpoint if you want to hit the breakpoint only for some condition or for ith recursion depth. If you want to unwind recursion, after some of your testing/validation, while debugging you can change the value of the base condition variable from eclipse debugger.

like image 114
Vallabh Patade Avatar answered Nov 12 '22 12:11

Vallabh Patade