Book Image

OpenJDK Cookbook

Book Image

OpenJDK Cookbook

Overview of this book

Table of Contents (20 chapters)
OpenJDK Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Debugging C++ code using NetBeans


If you plan to make changes to HotSpot or any other C++ part of OpenJDK, then it is certain that you will need to do some step-by-step debugging of the code. This recipe will explain how to set up NetBeans IDE for that purpose.

Getting ready

To get started, there are only a few things required—downloaded Open JDK sources and installed NetBeans IDE. It is assumed that the OpenJDK project is already set up and can build sources.

How to do it...

  1. The first step is to set up an executable that will run. Go to Run | Set project configuration / Customize and then Build | Make, and set build/linux-amd64-debug/hotspot/outputdir/linux_amd64_compiler2/jvmg/gamma as the build result, as shown in the following screenshot:

  2. Then select the Run option on the tree on the left had side and set Run Command as "${OUTPUT_PATH}" –version:

  3. The –version flag here is just the simplest thing you can run—get the Java version. You can later change it to whatever you want, for example, to...