Use eclipse to debug the agent program
Author: Chen yuefeng
From: http://blog.csdn.net/mailbomb
Eclipse is one of the main development tools used to develop the j2_program, and the ability to debug the program is also a must for programmers. This article assumes that eclipse and eclipseme have been installed. The following describes the debugging content:
1, Environment Settings
After eclipse and eclipseme are installed, if you need to debug the j2‑based program, you still need to set it before using it. The setting method is as follows:
Open "window"-> "Preferences"-> "Java"-> "debug"
Deselect the three options in suspend execution and set the value after debugger timeout (MS) to 20000.
After the configuration is complete, you can start debugging.
2, Set breakpoints
The eclipse debugger has been integrated into the eclipse SDK and does not need to be downloaded or installed separately. One of the core tasks of debugging programs is to set breakpoints. In fact, it is easy to set a breakpoint in IDE. You only need to click the cursor at the beginning of the Code in the corresponding line. Clicking again will cancel the breakpoint.
3, Execution Control
After a breakpoint is set, run the program in debug mode to start the program in debug mode. The program will be paused when it runs to the breakpoint. After the control menu is started in debug mode, it will appear in the eclipse run menu.
You can control the execution in the following ways:
L Step over (F6) -- one-step execution. When a method is called, it is not tracked inside the method.
L Step into (F5)-One-step execution, which is tracked inside the method when a method call is encountered
L Step return (F7) -- execute to the end of the method or the next breakpoint
L Resume (F8) -- execute to the next breakpoint
L Terminate -- terminate execution
L Run to line -- run to a specified row or next breakpoint
4, View variable values
In debugging mode, you only need to place the cursor over the corresponding variable to display the current value of the variable.
More debugging knowledge needs to be accumulated in the actual development process.
Advertisement: if the article is helpful to you, please vote for me in the MVB selection. Thank you! Voting address:
Http://www.csdn.net/community2006/vote/index.rails? Id = 1