Foreword: It is clear that Eclipse does not have the ability to run instant code like the instant windows of vs.
The interface for debugging is as follows:
Specific steps to debug:
1. Set breakpoints
Put a breakpoint inside the program, that is, double-click on the left side of the program where you want to place the breakpoint.
2. Commissioning
(1) Click the "Open Perspective" button, select the debug perspective, open the debug perspective interface, and then set a breakpoint, press the Debug button to debug the program.
(2) or directly click on the Debug button, the bug-like button, and then will enter the debug perspective interface. If you want to set a breakpoint in your program, you need to do so.
(3) or right-click the program, select Debug As (Debug), Java application (Java application), you can debug the program. If you want to set a breakpoint in your program, you need to do so.
3. Debugging shortcut keys
After running the Java program in debug mode
(F5) Step execution procedure, enter when encountering method;
(F6) One step to execute the program, the method is encountered when skipping;
(F7) stepping through the program, jumping out of the current method;
(F8) executes the program directly. Pauses when a breakpoint is encountered;
According to F5 is a layer of depth of debug equivalent to Peel onion samples, will enter each method inside;
Pressing F6 is a step-by-step debug in the current function, ignoring the deep-seated operation;
Pressing F7 is if you are currently inside a method, jump to the end code of the method;
Press F8 is if there is a breakpoint at the back, run to the next breakpoint, or run out of program;
In addition, when debugging, there will be a lot of useful information displayed in the Debug box, such as stack information, you need to practice, in the program interface, the mouse pointer over the variable will have the current variable property values.
4, change the value of the variable
Right-click the variable in the variables window and select [Change value] from the popup menu to pop up the edit screen.
After changing its value, press the OK button, and the value of the variable is changed to the modified value.
5. Check code Snippet Execution results
When the program runs, you want to see if a program is running correctly, or when you look at the value of a variable:
Select a sentence or a piece of code, right-click on the menu that pops up to select the watch (CREATE VIEW expression) item, at which point the execution results of the code are displayed in the Expressions (expression) window.
Select a sentence or a piece of code, right-click on the pop-up menu to select the Inspect (check) item, you can directly display the value of the expression.
Original: http://www.cnblogs.com/mq0036/p/3780538.html
Debugging capabilities for Eclipse (GO)