We often encounter such debugging problems. For example, there are 1000 times of a for loop, and the error occurs at the 83rd loop. At this time, I want to directly locate the 83rd loop. What should I do?
Very simple, using conditional breakpoints can be achieved.
Proceed as follows:
①Set a variable in the loop body, and the variable name is i.
②Click the mouse on the left side of the code line to add a breakpoint.
③Right-click at the breakpoint, as shown in the following figure after right-clicking:
fill in the trigger condition at the Condition in the above figure: for example, "input condition "i == 83"
After filling in, click "Done" to confirm.
When the debugger finds that i==83, it will pause at the breakpoint and enter the debug mode.