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

add ClearAllFramePops function to speedup debugger single stepping in some cases

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 25
    • hotspot
    • None
    • behavioral
    • minimal
    • The compatibility risk is minimal because new function ClearAllFramePops is being added.
    • Other
    • SE

      Summary

      Introduce new JVMTI function ClearAllFramePops will help to speedup debugger single stepping in some cases.

      Problem

      When a NotifyFramePop is done, it puts the thread in interp_only_mode. This is done mainly so JVMTI can detect when popping the frame for which NotifyFramePop has been called. Once this is done, interp_only_mode is disabled assuming there is nothing else keeping it enabled. The problem with doing NotifyFramePop is that even after single stepping completes, we won't yet have exited the frame that NotifyFramePop was setup on. This keeps the thread in interp_only_mode until that frame is exited. Worse case situation is you single step in the main method of the app, and the app (or at least the thread running the main method) is forever stuck in interp_only_mode.

      Solution

      The suggested solution is to add new JVMTI function ClearAllFramePops which will be used by the JDWP agent to remove all FramePop requests for the specified thread when single stepping for this thread has been completed.

      Specification

      The description of ClearAllFramePops is added to the Stack Frame section of the JVMTI spec (Stack Frame).

      This is an update of the jvmti.xml:

      +    <function id="ClearAllFramePops" num="67" since="25">
      +      <synopsis>Clear Frame Pop</synopsis>
      +      <description>
      +        Clear all frame pop requests so that a <eventlink id="FramePop"></eventlink>
      +        event will not be generated for any frames.
      +        See the <eventlink id="FramePop"></eventlink> event for details.
      +        <p/>
      +        The specified thread must be suspended or must be the current thread.
      +      </description>
      +      <origin>new</origin>
      +      <capabilities>
      +        <required id="can_generate_frame_pop_events"></required>
      +      </capabilities>
      +      <parameters>
      +        <param id="thread">
      +          <jthread null="current" impl="noconvert"/>
      +          <description>
      +            The thread for which all the frame pop events will be cleared.
      +          </description>
      +        </param>
      +      </parameters>
      +      <errors>
      +        <error id="JVMTI_ERROR_THREAD_NOT_SUSPENDED">
      +          Thread was not suspended and was not the current thread.
      +        </error>
      +     </errors>
      +    </function>

            sspitsyn Serguei Spitsyn
            sspitsyn Serguei Spitsyn
            Alan Bateman, Alex Menkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: