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>
- csr of
-
JDK-8346143 add ClearAllFramePops function to speedup debugger single stepping in some cases
-
- Resolved
-