StackFrame.SetValues, StackFrame.GetValues, ThreadReference.PopFrames, and ThreadReference.ForceEarlyReturn all need updated language related to OPAQUE_FRAME error.
(1) The spec for JVMTI says the following for GetLocalsXXX and SetLocalsXXX
The implementation is unable to set the frame locals
(e.g. the frame at depth is executing a native method).
However, the JDWP StackFrame.SetValues and GetValues commands only mention OPAQUE_FRAME for SetValues when not called for the topmost frame of a virtual thread suspended at an event. I don't think there is anything to prevent OPAQUE_FRAME due to the thread being native or some other reason as mentioned in the JVMTI spec. The JDWP spec should be updated to reflect this.
(2) The spec for JVMTI says the following for PopFrame and ForceEarlyReturn:
The implementation is unable to force the current frame to return
(e.g. current frame is executing a native method).
However, the JDWP ThreadReference.PopFrames, and ThreadReference.ForceEarlyReturn commands only mention OPAQUE_FRAME when this commands are not called for the topmost frame of a virtual thread suspended at an event. I don't think there is anything to prevent OPAQUE_FRAME due to the thread being native or some other reason as mentioned in the JVMTI spec. The JDWP spec should be updated to reflect this.
(3) Another issue is that INVALID_SLOT is missing in the JDWP spec for SetValues, but is there for GetValues. It should be mentioned for both commands.
(1) The spec for JVMTI says the following for GetLocalsXXX and SetLocalsXXX
The implementation is unable to set the frame locals
(e.g. the frame at depth is executing a native method).
However, the JDWP StackFrame.SetValues and GetValues commands only mention OPAQUE_FRAME for SetValues when not called for the topmost frame of a virtual thread suspended at an event. I don't think there is anything to prevent OPAQUE_FRAME due to the thread being native or some other reason as mentioned in the JVMTI spec. The JDWP spec should be updated to reflect this.
(2) The spec for JVMTI says the following for PopFrame and ForceEarlyReturn:
The implementation is unable to force the current frame to return
(e.g. current frame is executing a native method).
However, the JDWP ThreadReference.PopFrames, and ThreadReference.ForceEarlyReturn commands only mention OPAQUE_FRAME when this commands are not called for the topmost frame of a virtual thread suspended at an event. I don't think there is anything to prevent OPAQUE_FRAME due to the thread being native or some other reason as mentioned in the JVMTI spec. The JDWP spec should be updated to reflect this.
(3) Another issue is that INVALID_SLOT is missing in the JDWP spec for SetValues, but is there for GetValues. It should be mentioned for both commands.
- csr for
-
JDK-8362656 Fix JDWP spec w.r.t. OPAQUE_FRAME and INVALID_SLOT errors
-
- Proposed
-
- relates to
-
JDK-8309400 JDI spec needs to clarify when OpaqueFrameException and NativeMethodException are thrown
-
- Open
-
-
JDK-8309399 JVMTI spec needs to clarify when OPAQUE_FRAME is thrown for reasons other than a native method
-
- Resolved
-
- links to
-
Review(master) openjdk/jdk/26336