The JDI provides introspective access to a running virtual machine's state, Class, Array, Interface, and primitive types, and instances of those types.
The JDI also provides explicit control over a virtual machine's execution. The ability to suspend and resume threads, and to set breakpoints, watchpoints, ... Notification of exceptions, class loading, thread creation... The ability to inspect a suspended thread's state, local variables, stack backtrace...
JDI is the highest-layer of the Java Platform Debugger Architecture (JPDA). For more information on the Java Platform Debugger Architecture, see the Java Platform Debugger Architecture documentation for this release and the Java Platform Debugger Architecture website.
Global Exceptions:
This section documents exceptions which apply to the entire API and are thus not documented on individual methods.
NOTE: The exceptions below may be thrown whenever the specified conditions are met but a guarantee that they are thrown only exists when a valid result cannot be returned.{@link com.sun.jdi.VMMismatchException}
Any method on a {@link com.sun.jdi.Mirror} that takes a
Mirror
as an parameter directly or indirectly (e.g., as a element in aList
) will throw {@link com.sun.jdi.VMMismatchException} if the mirrors are from different virtual machines.{@link java.lang.NullPointerException}
Any method which takes a {@link java.lang.Object} as an parameter will throw {@link java.lang.NullPointerException} if null is passed directly or indirectly -- unless null is explicitly mentioned as a valid parameter.
{@link com.sun.jdi.VMDisconnectedException}
Any method on {@link com.sun.jdi.ObjectReference}, {@link com.sun.jdi.ReferenceType}, {@link com.sun.jdi.request.EventRequest}, {@link com.sun.jdi.StackFrame}, or {@link com.sun.jdi.VirtualMachine} or which takes one of these directly or indirectly as an parameter may throw {@link com.sun.jdi.VMDisconnectedException} if the target VM is disconnected and the {@link com.sun.jdi.event.VMDisconnectEvent} has been or is available to be read from the {@link com.sun.jdi.event.EventQueue}.
{@link com.sun.jdi.VMOutOfMemoryException}
Any method on {@link com.sun.jdi.ObjectReference}, {@link com.sun.jdi.ReferenceType}, {@link com.sun.jdi.request.EventRequest}, {@link com.sun.jdi.StackFrame}, or {@link com.sun.jdi.VirtualMachine} or which takes one of these directly or indirectly as an parameter may throw {@link com.sun.jdi.VMOutOfMemoryException} if the target VM has run out of memory.
{@link com.sun.jdi.ObjectCollectedException}
Any method on {@link com.sun.jdi.ObjectReference} or which directly or indirectly takes
ObjectReference
as parameter may throw {@link com.sun.jdi.ObjectCollectedException} if the mirrored object has been garbage collected.Any method on {@link com.sun.jdi.ReferenceType} or which directly or indirectly takes
ReferenceType
as parameter may throw {@link com.sun.jdi.ObjectCollectedException} if the mirrored type has been unloaded.