Use eclipse to debug the agent program

Source: Internet
Author: User

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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.