Summary
Specify minimal StackFrame.setValue() and JDWP StackFrame.setValues minimal support for virtual threads.
Problem
The JDWP spec for StackFrame.SetValue currently states:
"If the thread is a virtual thread then this command can be used to set "
"the value of local variables in the top-most frame when the thread is "
"suspended at a breakpoint or single step event. The target VM may support "
"setting local variables in other cases."
The JDI spec for StackFrame.setValue() has similar wording. In JDK-8308814 the JVMTI spec for SetLocalXXX() clarified support to be for a thread suspended at any event, not just a breakpoint or single step. That same clarification is needed in the JDWP and JDI specs.
Solution
Change JDI and JDWP spec wording to indicate support at any event, not just at breakpoint or single step events. No implementation changes are needed.
Specification
JDWP StackFrame.SetValues spec changes:
diff --git a/src/java.se/share/data/jdwp/jdwp.spec b/src/java.se/share/data/jdwp/jdwp.spec
index 0c4c5ed5c24..8575edd54c3 100644
--- a/src/java.se/share/data/jdwp/jdwp.spec
+++ b/src/java.se/share/data/jdwp/jdwp.spec
@@ -2641,7 +2641,7 @@ JDWP "Java(tm) Debug Wire Protocol"
"<p>"
"If the thread is a virtual thread then this command can be used to set "
"the value of local variables in the top-most frame when the thread is "
- "suspended at a breakpoint or single step event. The target VM may support "
+ "suspended at an event. The target VM may support "
"setting local variables in other cases."
(Out
(threadObject thread "The frame's thread. ")
JDI StackFrame.setValue() spec changes
diff --git a/src/jdk.jdi/share/classes/com/sun/jdi/StackFrame.java b/src/jdk.jdi/share/classes/com/sun/jdi/StackFrame.java
index 204760e006f..f00bc206f85 100644
--- a/src/jdk.jdi/share/classes/com/sun/jdi/StackFrame.java
+++ b/src/jdk.jdi/share/classes/com/sun/jdi/StackFrame.java
@@ -201,7 +201,7 @@ public interface StackFrame extends Mirror, Locatable {
* <p>
* In the case of virtual threads, the target VM supports setting values
* of local variables when this frame is the topmost frame and the thread
- * is suspended at a breakpoint or single step event. The target VM may
+ * is suspended at an event. The target VM may
* support setting local variables in other cases.
* <p>
* Object values must be assignment compatible with the variable type
- csr of
-
JDK-8309146 extend JDI StackFrame.setValue() and JDWP StackFrame.setValues minimal support for virtual threads
-
- Resolved
-