Working with MS VM
 
 

Microsoft VM   Previous VM Next
Java Language Debug Interfaces   Previous VM Next

 

Overview

The Java debug interfaces allow developers to write sophisticated programs for debugging Java applications and applets run in the Microsoft Win32 Virtual Machine for Java (Microsoft VM). These interfaces can also be used for debugging Java applications and applets that mix Java classes with native code for Win32.

The Java debug interfaces consist of a series of Component Object Model (COM) objects and interfaces implemented by the Microsoft VM. A debugger application is usually written in C, C++, or some other language that can access these published COM interfaces and objects for communicating with the Microsoft VM and control the Java execution environment. A debugger program written to use these COM interfaces must also implement two COM interfaces that are used as callback interfaces through which the Microsoft VM communicates with the debugger. Because these debug interfaces are all based on COM, debugger programs can be easily extended to allow remote debugging using Distributed COM (DCOM). These debug interfaces are also provided as wrapped COM interfaces in Java as a set of classes under the com.ms.debug package, enabling developers to write debugger programs in Java as well as C++. For simplicity, the examples that follow are written using C++ and local COM objects to illustrate the use of the Java debug interfaces.

To use these Java debug interfaces, debugging must be enabled in the Microsoft VM before the Java application or applet begins its execution. Debugging can be enabled in the Microsoft VM through particular environment variables or with Win32 registry settings.

The debug interfaces used by the Microsoft VM can be organized into several categories as shown in the following table.

Category Purpose
Registration Interfaces called by the debugger program to register with the Microsoft VM and request to be notified when specific events occur.
Notification Callback interfaces that must be implemented by the debugger through which the Microsoft VM notifies the debugger of various events and returns requested information.
Static Information Interfaces used by the debugger program to gather static information about the Java application or applet.
Dynamic Information Interfaces used by the debugger program to gather dynamic information about the Java application or applet when it is executing.
Execution Control Interfaces used by the debugger program to control the execution of a Java application or applet within the Microsoft VM.

The Microsoft VM includes sample code for two debugger applications that illustrate how to use these Java debug interfaces. One sample is written in C++ using these interfaces. A second example is written in Java using the com.ms.debug package, which consists of a set of Java-wrapped classes for these COM interface objects. These samples are installed under the Samples\Debugger subdirectory of the SDK for Java.

Top © 1998 Microsoft Corporation. All rights reserved. Terms of use.