Most @java programmers only use 10% of their... debugger.
Use the full power of your debugger with advanced breakpoints.
Diagnose complex bugs in minutes, instead of hours.
Test your debugger skills with 4 challenges in this thread. Works with @intellijidea and other IDEs. 🧵
Use the full power of your debugger with advanced breakpoints.
Diagnose complex bugs in minutes, instead of hours.
Test your debugger skills with 4 challenges in this thread. Works with @intellijidea and other IDEs. 🧵
Once you know that iteration 666 of the loop is problematic, you can put a Conditional Breakpoint at the beginning of the loop with the condition "i == 666", so you can step through the code inside the loop, one line at a time.
4) Alternative solutions:
- Pass Count Breakpoint, if you know how many times calcAge() is called before you want it to halt
- Conditional Breakpoint, if you can afford to rely in the variable count.
If these works: Great, use them!
But it depends on the case.
- Pass Count Breakpoint, if you know how many times calcAge() is called before you want it to halt
- Conditional Breakpoint, if you can afford to rely in the variable count.
If these works: Great, use them!
But it depends on the case.
These 4 advanced debugging techniques don't just shine to find the cause of a bug.
They also help to understand what a piece of code behaves in particular circumstances.
Or - when you make code changes - how the behavior of a piece of code changes.
They also help to understand what a piece of code behaves in particular circumstances.
Or - when you make code changes - how the behavior of a piece of code changes.
I hope you found these debugging tricks useful for your future bug hunts!
If you found this thread useful, you might find this one about JVM classloading useful too:
Or this one about profiling Java applications:
Loading suggestions...