jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/EventRequestManager.java
changeset 30037 3e785fad2c3b
parent 25859 3317bb8137f4
child 34894 3248b89d1921
equal deleted inserted replaced
30036:3d4eb4503c18 30037:3e785fad2c3b
   215      * The new event request is added to the list managed by this
   215      * The new event request is added to the list managed by this
   216      * EventRequestManager. Use {@link EventRequest#enable()} to
   216      * EventRequestManager. Use {@link EventRequest#enable()} to
   217      * activate this event request.
   217      * activate this event request.
   218      * <p>
   218      * <p>
   219      * The returned request will control stepping only in the specified
   219      * The returned request will control stepping only in the specified
   220      * <code>thread</code>; all other threads will be unaffected.
   220      * {@code thread}; all other threads will be unaffected.
   221      * A <code>size</code>value of {@link com.sun.jdi.request.StepRequest#STEP_MIN} will generate a
   221      * A {@code size} value of {@link com.sun.jdi.request.StepRequest#STEP_MIN} will generate a
   222      * step event each time the code index changes. It represents the
   222      * step event each time the code index changes. It represents the
   223      * smallest step size available and often maps to the instruction
   223      * smallest step size available and often maps to the instruction
   224      * level.
   224      * level.
   225      * A <code>size</code> value of {@link com.sun.jdi.request.StepRequest#STEP_LINE} will generate a
   225      * A {@code size} value of {@link com.sun.jdi.request.StepRequest#STEP_LINE} will generate a
   226      * step event each time the source line changes unless line number information is not available,
   226      * step event each time the source line changes unless line number information is not available,
   227      * in which case a STEP_MIN will be done instead.  For example, no line number information is
   227      * in which case a STEP_MIN will be done instead.  For example, no line number information is
   228      * available during the execution of a method that has been rendered obsolete by
   228      * available during the execution of a method that has been rendered obsolete by
   229      * by a {@link com.sun.jdi.VirtualMachine#redefineClasses} operation.
   229      * by a {@link com.sun.jdi.VirtualMachine#redefineClasses} operation.
   230      * A <code>depth</code> value of {@link com.sun.jdi.request.StepRequest#STEP_INTO} will generate
   230      * A {@code depth} value of {@link com.sun.jdi.request.StepRequest#STEP_INTO} will generate
   231      * step events in any called methods.  A <code>depth</code> value
   231      * step events in any called methods.  A {@code depth} value
   232      * of {@link com.sun.jdi.request.StepRequest#STEP_OVER} restricts step events to the current frame
   232      * of {@link com.sun.jdi.request.StepRequest#STEP_OVER} restricts step events to the current frame
   233      * or caller frames. A <code>depth</code> value of {@link com.sun.jdi.request.StepRequest#STEP_OUT}
   233      * or caller frames. A {@code depth} value of {@link com.sun.jdi.request.StepRequest#STEP_OUT}
   234      * restricts step events to caller frames only. All depth
   234      * restricts step events to caller frames only. All depth
   235      * restrictions are relative to the call stack immediately before the
   235      * restrictions are relative to the call stack immediately before the
   236      * step takes place.
   236      * step takes place.
   237      * <p>
   237      * <p>
   238      * Only one pending step request is allowed per thread.
   238      * Only one pending step request is allowed per thread.
   239      * <p>
   239      * <p>
   240      * Note that a typical debugger will want to cancel stepping
   240      * Note that a typical debugger will want to cancel stepping
   241      * after the first step is detected.  Thus a next line method
   241      * after the first step is detected.  Thus a next line method
   242      * would do the following:
   242      * would do the following:
   243      * <code>
   243      * <pre>{@code
   244      * <pre>
       
   245      *     EventRequestManager mgr = myVM.{@link VirtualMachine#eventRequestManager eventRequestManager}();
   244      *     EventRequestManager mgr = myVM.{@link VirtualMachine#eventRequestManager eventRequestManager}();
   246      *     StepRequest request = mgr.createStepRequest(myThread,
   245      *     StepRequest request = mgr.createStepRequest(myThread,
   247      *                                                 StepRequest.{@link StepRequest#STEP_LINE STEP_LINE},
   246      *                                                 StepRequest.{@link StepRequest#STEP_LINE STEP_LINE},
   248      *                                                 StepRequest.{@link StepRequest#STEP_OVER STEP_OVER});
   247      *                                                 StepRequest.{@link StepRequest#STEP_OVER STEP_OVER});
   249      *     request.{@link EventRequest#addCountFilter addCountFilter}(1);  // next step only
   248      *     request.{@link EventRequest#addCountFilter addCountFilter}(1);  // next step only
   250      *     request.enable();
   249      *     request.enable();
   251      *     myVM.{@link VirtualMachine#resume resume}();
   250      *     myVM.{@link VirtualMachine#resume resume}();
   252      * </pre>
   251      * }</pre>
   253      * </code>
       
   254      *
   252      *
   255      * @param thread the thread in which to step
   253      * @param thread the thread in which to step
   256      * @param depth the step depth
   254      * @param depth the step depth
   257      * @param size the step size
   255      * @param size the step size
   258      * @return the created {@link StepRequest}
   256      * @return the created {@link StepRequest}