模块 jdk.jdi

定义Java调试接口。

Java™调试接口(JDI)是一种高级Java API,提供对需要访问(通常是远程)虚拟机的运行状态的调试器和类似系统有用的信息。

JDI提供对正在运行的虚拟机的状态,类,数组,接口和基元类型以及这些类型的实例的内省访问。

JDI还提供对虚拟机执行的显式控制。 能够挂起和恢复线程,设置断点,观察点等。异常通知,类加载,线程创建等。检查挂起线程的状态,局部变量,堆栈回溯等的能力。

JDI是Java Platform Debugger Architecture (JPDA)的最高层

该模块包括一个简单的命令行调试器, jdb

全球例外

本节介绍适用于整个API的异常,因此不会记录在各个方法中。

VMMismatchException

Any method on a Mirror that takes a Mirror as an parameter directly or indirectly (e.g., as a element in a List) will throw VMMismatchException if the mirrors are from different virtual machines.

NullPointerException

Any method which takes a Object as an parameter will throw NullPointerException if null is passed directly or indirectly -- unless null is explicitly mentioned as a valid parameter.

注意:只要满足指定的条件,就可以抛出以下异常,但只有在无法返回有效结果时才保证抛出它们。

VMDisconnectedException

Any method on ObjectReference, ReferenceType, EventRequest, StackFrame, or VirtualMachine or which takes one of these directly or indirectly as an parameter may throw VMDisconnectedException if the target VM is disconnected and the VMDisconnectEvent has been or is available to be read from the EventQueue.

VMOutOfMemoryException

Any method on ObjectReference, ReferenceType, EventRequest, StackFrame, or VirtualMachine or which takes one of these directly or indirectly as an parameter may throw VMOutOfMemoryException if the target VM has run out of memory.

ObjectCollectedException

Any method on ObjectReference or which directly or indirectly takes ObjectReference as parameter may throw ObjectCollectedException if the mirrored object has been garbage collected.

Any method on ReferenceType or which directly or indirectly takes ReferenceType as parameter may throw ObjectCollectedException if the mirrored type has been unloaded.

工具指南:
jdb
模块图:
Module graph for jdk.jdiModule graph for jdk.jdi
从以下版本开始:
9
另请参见:
Java Platform Debugger Architecture (JPDA)