Apache Harmony is retired at the Apache Software Foundation since Nov 16, 2011.

The information on these pages may be out of date, or may refer to resources that have moved or have been made read-only.
For more information please refer to the Apache Attic

Native Code Access Interface

Native Code Access Interface

  1. About This Document
  2. Overview
  3. Key Features
  4. NCAI in VM
  5. Known issues
  6. References

About This Document

This document introduces the Native Code Access Interface and its implementation inside the DRL virtual machine.

Overview

Some Java* applications need to access native code via the Java* Native Interface (JNI) [1] to access native code. Common Java* debuggers, such as Eclipse* and NetBeans* debuggers, do not fully support debugging native code written in programming languages like C/C++. Some techniques, like the CDT plugin for Eclipse*, are used for debugging native code in Java* applications, but all of them have their own limitations.

Native Code Access Interface (NCAI) is a different approach to debugging JNI code in Java* applications. Together with JVMTI [2] it provides in-process debugging of both JIT-compiled and interpreted Java* bytecode, and native JNI code.

NCAI interface is a JVMTI-like interface exposed by DRLVM through a JVMTI extension. See detailed NCAI description for interface details.

The Eclipse* plugin utilizing NCAI interface is available at Intel* What If site [3]. This plugin supports Java* and C/C++, and builds into Eclipse* IDE re-using JDT and CDT debug views.

Examples of NCAI usage can be found in NCAI tests sources: trunk/drlvm/vm/tests/ncai.

Back to Top

Key Features

The current NCAI implementation supports x86 architecture; some features are available on x86_64.

Main NCAI features implemented for now:

Back to Top

NCAI in VM

NCAI is implemented as a part of DRLVM. The source code is generally located in the trunk/drlvm/vm/vmcore/src/ncai directory, with platform-dependent code in 'utils' subdirectory.

In addition to standalone code, NCAI includes code and changes in other parts of DRLVM, specifically:

Back to Top

Known issues

Known issues and limitations in the current NCAI implementation include:

Back to Top

References

This section lists the resources used in this document and other related documents.

[1] Java* Native Interface Specification, http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html

[2] JVM Tool Interface Specification, http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html

[3] Intel* What If site, http://whatif.intel.com

Back to Top

* Other brands and names are the property of their respective owners.