Configuring Eclipse to debug concurrent code

Source: Internet
Author: User
Configuring Eclipse to debug concurrent code

One of the most useful features of the IDE is debugger. You can perform your application step-by-step and analyze the values of all objects and variables in your program.

If you use the Java programming language, Eclipse is one of the most common Ides. It has a built-in debugger (integrated debugger) that allows you to test your application. By default, the debugger finds a breakpoint (breakpoint) when you test the concurrent application, it simply stops the thread with the breakpoint (breakpoint) and the other threads continue their operation.

In this guide, you will learn how to change the configuration to help test concurrent applications.

Follow these steps to implement the following example:: Select menu Options Window | Preferences. On the left-hand side of the menu, extend the Java option. On the left-hand side of the menu, select the Debug option. The screenshot below shows how the window looks:
Change the value of the default suspend policy to convert suspend Thread to the suspend VM (marked with red in the screenshot) for new breakpoints. Click the OK button to determine the modification. principle

As we mentioned in the introduction to this guide, by default, when you debug concurrent Java applications with eclipse, the debugging process looks for breakpoints, pausing only the threads that first hit the breakpoint, and the other threads will continue their operation.

The following illustration shows the case of the example:

As we mentioned in the introduction to this guide, by default, when you debug concurrent Java applications with eclipse, the debugging process looks for breakpoints, pausing only the threads that first hit the breakpoint, and the other threads will continue their operation.

The following illustration shows the case of the example:

With these changes, you can see that all the threads have been paused. You can continue any thread you want to debugging. Choose the Pause method that best suits your needs.

Turn from: Ifeve

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.