Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8309149

extend JDI StackFrame.setValue() and JDWP StackFrame.setValues minimal support for virtual threads

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 21
    • core-svc
    • None
    • behavioral
    • minimal
    • Hide
      The compatibility risk is minimal. The spec update only extends the SetValue(s) minimal support for suspended virtual threads to be at any event rather than just at a breakpoint or single step event.
      Show
      The compatibility risk is minimal. The spec update only extends the SetValue(s) minimal support for suspended virtual threads to be at any event rather than just at a breakpoint or single step event.
    • Java API, File or wire format
    • SE

      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

            cjplummer Chris Plummer
            cjplummer Chris Plummer
            Alan Bateman, Serguei Spitsyn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: