JavaTM Platform Debugger Architecture

Home Page

Architecture Overview

The JavaTM Platform Debugger Architecture is structured as follows:
             Components                         Debugger Interfaces

                /    |--------------|
               /     |     VM       |
 debuggee ----(      |--------------|  <------- JVMTI - Java VM Tool Interface
               \     |   back-end   |
                \    |--------------|
                /           |
 comm channel -(            |  <--------------- JDWP - Java Debug Wire Protocol
                \           |
                     | front-end    |
                     |--------------|  <------- JDI - Java Debug Interface
                     |      UI      |

What is the Java Platform Debugger Architecture (JPDA)?

JPDA is a multi-tiered debugging architecture that allows tools developers to easily create debugger applications which run portably across platforms, virtual machine (VM) implementations and JDK versions.

JPDA consists of three layers:

JVMTI - Java VM Tool Interface
JVMTI is a new interface in J2SE 5.0 which replaces JVMDI. It defines the debugging services a VM provides.
JDWP - Java Debug Wire Protocol
Defines the communication between debuggee and debugger processes.
JDI - Java Debug Interface
Defines a high-level Java language interface which tool developers can easily use to write remote debugger applications.

Reference implementation

In addition to the specification of these interfaces, Sun Microsystems also provides a reference implementation, which consists of: This provides a layered implementation in which any layer may be substituted.

Using JPDA

A debugger developer may hook into JPDA at any layer. Since the JDI is the highest level and easiest to use we encourage developers to use this interface. Suppose a company develops a debugger using JDI. They can use it with the reference implementation and it will automatically work with the VMs and platforms Sun supports. It can also work, for example, with the reference implementation front-end and a debuggee running another company's VM that implements JDWP (which might use or by-pass JVMTI).

Some debuggers are built on top of lower layers, JDWP (for example if the front-end is not written in the Java language) or JVMTI (for specialized debuggers which need low-level functionality).



Java Virtual Machine (VM)


communications channel

The communications channel is the link between the front and back ends of the debugger. It can be thought of as consisting of two mechanisms:

  1. A connector. A connector is a JDI object that is the means by which a connection is established between the front and back-ends.

    JPDA defines three types of connectors:

    • listening connectors: The front-end listens for an incoming connection from the back-end
    • attaching connectors: The front-end attaches to an already running back-end.
    • launching connectors: The front-end actually launches the java process that will run the debuggee code and the back-end.

  2. A transport. A transport is the underlying mechanism used to move bits between the front-end and the back-end.

    The transport mechanism used is unspecified; possible mechanisms include: sockets, serial lines, and shared memory. However, the format and semantics of the serialized bit-stream flowing over the channel is specified by the Java Debug Wire Protocol (JDWP).
Starting with J2SE 5.0, JPDA includes service provider interfaces to allow the development and deployment of connector and transport implementations. These service provider interfaces allow debugger and other tool vendors to develop new connector implementations and provide addition transport mechanisms over and beyond the socket and shared memory transport provided by Sun. The service provider interfaces in JDI are specified in the com.sun.jdi.connect.spi package.

In addition to the service provider interfaces in JDI, JPDA also defines a transport library interface called the Java TMDebug Wire Protocol Transport Interface. A transport library is loaded by the JDWP agent in the target VM and is used to establish a connection to the debugger and to transport JDWP packets between the debugger and the VM.

See JavaTM Platform Debugger Architecture - Service Provider Interfaces for more information on using these SPIs.


User Interface (UI)


Debugger Interfaces

Java Virtual Machine Tool Interface (JVMTI)

Java Debug Wire Protocol (JDWP)

Java Debug Interface (JDI)

Copyright © 2004 Sun Microsystems, Inc. All Rights Reserved. 

Please send comments to: