Debug mode

Debug mode

How to enter debug mode

        When running the main function or unit test, ctrl+shift+d,j or right-click Debug As -java Application

As shown in the figure:

The purpose of using Debug mode

1. Whether the tracking program follows the expected process

2. View some variable values ​​during operation

Debug common shortcut keys

ctrl+shift+b: open and close breakpoints

ctrl+alt+b: open, skip all existing breakpoints

        Ctrl+shift+i: View the value of the selected variable

        F5: Enter into the currently running program

        F6: the next line of the current program

        F7: Step out of function

        F8: run the current breakpoint

1. Skipall breakpoint The current state of this icon means that all breakpoints are turned on: as long as the program is in debug mode and there are breakpoints in the program, the program will pass through each breakpoint during the running process. If there is a problem with some code in the program, you can put a breakpoint on that line of code. As shown in line 12, I want to quickly open the breakpoint method: 1. Double-click the line mark of the current line, 2. ctrl+shift+b, when the breakpoint mark appears at the line mark, it means the breakpoint is successfully hit. Shortcut Ctrl+alt+b

2. The resume state as shown in the figure represents that the program is waiting. If you click directly, the program will continue to run until the next breakpoint or the program ends. Shortcut key F8

3. Stepinto If the current program is called, it will enter the called content. If you don't understand the called method and want to see how the called method works internally, you can click this icon. Shortcut key F5

4. If Stepover is clicked, the procedure will only be executed sequentially in the current method. This process is the most used and the quickest to find problems in the development process. Shortcut key F6

5. Debug: This is a debug view. Generally, entering debug mode will open this view.

6. Veriables: The variables in the current class are stored here, and the variable values ​​can be viewed

7. Breakpoint: All breakpoint records are recorded here, you can skip, delete breakpoints, and view the breakpoint properties (such as where the breakpoint is hit), where hit count sets the number of executions suitable for the for loop in the program (setting breakpoint view-right click hit count) 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325642751&siteId=291194637