Is it possible to create a breakpoint where the condition is that its the start of the recursive process? In other words, the stack should only have one call to the function.
IE consider this workflow:
Main func -> call recursive func -> hit breakpoint -> continue -> recursively call self -> DONT hit breakpoint -> continue recursion.
Try this:
if(!Thread.currentThread().getStackTrace()[2].getMethodName().equals("this method's name"))
// breakpoint
The 2 is because getStackTrace will return the actual getStackTrace method as part of the stack, your method name, and THEN the caller method, which we want.
I don't this why you want to corrupt your code to achieve this unless you are creating break point programmatically.
Keep the break point inside the recursive function then right click on the break point and select break point properties the enter hit count 1. After hitting the break point first time it going to be disabled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With