Remember your own learning experience, for your own future debugging convenience.
1. Operation steps:
1.1 Add a breakpoint
Just click the left mouse button on the mark. (To delete a breakpoint, just click on the breakpoint again)
1.2 Run the code under Debug
as the picture shows:
Click this seven-star ladybug
1-3. Debug the code according to the required debugging
2. The debugging method of Debug is as follows:
2.1.show execution point (F10)
Show all current breakpoints
2.step over(F8)
Single step debugging.
If there is sub-function a in function A, it will not enter sub-function a to perform single-step debugging, but take sub-function a as a whole and execute it in one step.
3.step into(F7)
Single step debugging.
If there is sub-function a in function A, it will enter sub-function a to perform single-step debugging.
4.step into my code(Alt + Shift +F7)
Enter my code, step through debugging, execute the next line but ignore libraries. The difference between
it and step into
is:
- step into my code means that debug will only execute step by step inside the code you wrote.
- Although step into is also executed step by step, it may enter the execution of system functions, for example, regular re and so on.
Recommended use:, step into my code
if you are concerned about the execution logic of the bottom of the system, you can usestep into
5.force step into(Alt + Shift +F7)
Execute the next line to ignore lib and construction objects, etc.
6.step out(Shift+F8)
When the current execution is in the sub-function a, select this debugging operation to jump out of the sub-function a directly without continuing to execute the remaining code in the sub-function a. And return to the previous function.
That is to say, jump directly out of the function where the current debug is located, and enter the next statement that needs to be executed
7.run to cursor(Alt +F9)
Jump directly to the next breakpoint (jump from the current breakpoint to the next breakpoint)
The summary is:
7 in, 8 out, 9 jump
F7 to enter the code, F8 out of the code, F9 to switch to the specified code or code file