Source debugging of hotspots in eclipse

Source: Internet
Author: User
Tags gtk

This article address: http://www.cnblogs.com/myresearch/p/ide-buildhotspot.html, reprint please indicate source address.

In the process of reading OPENJDK source code, often need to run, debugging programs to help understand. We can now compile a debug version of the Hotspot virtual machine, disable optimizations, and have symbolic information so that GDB can be used for debugging. Many developers who know more about virtual machines are really directly using the GDB and Vim editor to develop and modify the hotspot, but believe that most readers prefer to read and track the hotspot source code in an IDE environment rather than a plain text gdb. In the previous article has described how to compile OpenJDK7 source code on the CentOS6.5, and now continue to describe how to build the eclipse-based hotspot source debugging environment under Linux.

Software Environment
    • Os:centos 6.5

    • JDK version:openjdk-7u6-fcs-src-b24-28_aug_2012

    • Ide:eclipse-cpp-kepler-sr2-linux-gtk-x86_64

Download Eclipse, Address: http://www.eclipse.org/cdt/downloads.php, and note that Eclipse supports the C + + version.

I downloaded the eclipse-cpp-kepler-sr2-linux-gtk-x86_64.tar.gz.

Specific operation

Step 1: First unpack the JDK source package, start Eclipse, select File > New >Makefile Project with Existing Code

The following interface appears:

Step 2: Navigate to Project name 右键 > Properties > C/C++ Build need to modify two places:

    • Remove the checkmark from the builder's use default Build command, and fill in the parametersARCH_DATA_MODEL=64

    • The build directory of build location is appended with/make, and eventually ${workspace_loc:/hotspot}/make, to tell the make compiler to look for the compiled file makefile in that directory.

Step 3: Select Menu bar Project > Build Project , see already started build, lunch break (first build probably need 10-20m).

Section log information:

......

Info:enable_full_debug_symbols=1
INFO:/usr/bin/objcopy cmd found so would create. debuginfo files.
Info:strip_policy=min_strip
Info:zip_debuginfo_files=1
MAKE[1]: Entering directory '/home/jvm/opt/openjdk/hotspot/make '
Make[1]: Nothing to is done for ' generic_export '.
MAKE[1]: Leaving directory '/home/jvm/opt/openjdk/hotspot/make '

02:01:39 Build finished (took 23s.540ms)

Step 4: After the compilation is successful, you can test it, and you need to configure the following steps:

    • Click the menu bar, run > Debug configurations > New launch Configuration, and fill in the/home/jvm/opt/openjdk/hotspot/in A/C + + Application Build/linux/linux_amd64_compiler2/fastdebug/gamma

    • Project selects the current project.

    • In Argument tab, program arguments fill in-version

    • In Environment tab environment variables to set fill in Java_home | /application/java/jdk

    • Check Debug in Common tab

After the configuration is complete, click Debug to enter debug mode

Resources

"Deep Java Virtual machine"

Source debugging of hotspots in eclipse

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.