jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/EventRequestManager.java
changeset 45564 0149773a140c
parent 34894 3248b89d1921
equal deleted inserted replaced
45563:ece4ae6beba3 45564:0149773a140c
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package com.sun.jdi.request;
    26 package com.sun.jdi.request;
    27 
    27 
    28 import com.sun.jdi.*;
       
    29 
       
    30 import java.util.List;
    28 import java.util.List;
       
    29 
       
    30 import com.sun.jdi.Field;
       
    31 import com.sun.jdi.Location;
       
    32 import com.sun.jdi.Mirror;
       
    33 import com.sun.jdi.NativeMethodException;
       
    34 import com.sun.jdi.ReferenceType;
       
    35 import com.sun.jdi.ThreadReference;
       
    36 import com.sun.jdi.VirtualMachine;
       
    37 import com.sun.jdi.event.BreakpointEvent;
       
    38 import com.sun.jdi.event.Event;
       
    39 import com.sun.jdi.event.EventSet;
       
    40 import com.sun.jdi.event.ExceptionEvent;
       
    41 import com.sun.jdi.event.VMDeathEvent;
    31 
    42 
    32 /**
    43 /**
    33  * Manages the creation and deletion of {@link EventRequest}s. A single
    44  * Manages the creation and deletion of {@link EventRequest}s. A single
    34  * implementor of this interface exists in a particuar VM and
    45  * implementor of this interface exists in a particular VM and
    35  * is accessed through {@link VirtualMachine#eventRequestManager()}
    46  * is accessed through {@link VirtualMachine#eventRequestManager()}
    36  *
    47  *
    37  * @see EventRequest
    48  * @see EventRequest
    38  * @see com.sun.jdi.event.Event
    49  * @see Event
    39  * @see BreakpointRequest
    50  * @see BreakpointRequest
    40  * @see com.sun.jdi.event.BreakpointEvent
    51  * @see BreakpointEvent
    41  * @see VirtualMachine
    52  * @see VirtualMachine
    42  *
    53  *
    43  * @author Robert Field
    54  * @author Robert Field
    44  * @since  1.3
    55  * @since  1.3
    45  */
    56  */
    95      * A specific exception type and its subclasses can be selected
   106      * A specific exception type and its subclasses can be selected
    96      * for exception events. Caught exceptions,  uncaught exceptions,
   107      * for exception events. Caught exceptions,  uncaught exceptions,
    97      * or both can be selected. Note, however, that
   108      * or both can be selected. Note, however, that
    98      * at the time an exception is thrown, it is not always
   109      * at the time an exception is thrown, it is not always
    99      * possible to determine whether it is truly caught. See
   110      * possible to determine whether it is truly caught. See
   100      * {@link com.sun.jdi.event.ExceptionEvent#catchLocation} for
   111      * {@link ExceptionEvent#catchLocation} for
   101      * details.
   112      * details.
   102      * @param refType If non-null, specifies that exceptions which are
   113      * @param refType If non-null, specifies that exceptions which are
   103      *                instances of refType will be reported. Note: this
   114      *                instances of refType will be reported. Note: this
   104      *                will include instances of sub-types.  If null,
   115      *                will include instances of sub-types.  If null,
   105      *                all instances will be reported
   116      *                all instances will be reported
   215      * EventRequestManager. Use {@link EventRequest#enable()} to
   226      * EventRequestManager. Use {@link EventRequest#enable()} to
   216      * activate this event request.
   227      * activate this event request.
   217      * <p>
   228      * <p>
   218      * The returned request will control stepping only in the specified
   229      * The returned request will control stepping only in the specified
   219      * {@code thread}; all other threads will be unaffected.
   230      * {@code thread}; all other threads will be unaffected.
   220      * A {@code size} value of {@link com.sun.jdi.request.StepRequest#STEP_MIN} will generate a
   231      * A {@code size} value of {@link StepRequest#STEP_MIN} will generate a
   221      * step event each time the code index changes. It represents the
   232      * step event each time the code index changes. It represents the
   222      * smallest step size available and often maps to the instruction
   233      * smallest step size available and often maps to the instruction
   223      * level.
   234      * level.
   224      * A {@code size} value of {@link com.sun.jdi.request.StepRequest#STEP_LINE} will generate a
   235      * A {@code size} value of {@link StepRequest#STEP_LINE} will generate a
   225      * step event each time the source line changes unless line number information is not available,
   236      * step event each time the source line changes unless line number information is not available,
   226      * in which case a STEP_MIN will be done instead.  For example, no line number information is
   237      * in which case a STEP_MIN will be done instead.  For example, no line number information is
   227      * available during the execution of a method that has been rendered obsolete by
   238      * available during the execution of a method that has been rendered obsolete by
   228      * by a {@link com.sun.jdi.VirtualMachine#redefineClasses} operation.
   239      * by a {@link VirtualMachine#redefineClasses} operation.
   229      * A {@code depth} value of {@link com.sun.jdi.request.StepRequest#STEP_INTO} will generate
   240      * A {@code depth} value of {@link StepRequest#STEP_INTO} will generate
   230      * step events in any called methods.  A {@code depth} value
   241      * step events in any called methods.  A {@code depth} value
   231      * of {@link com.sun.jdi.request.StepRequest#STEP_OVER} restricts step events to the current frame
   242      * of {@link StepRequest#STEP_OVER} restricts step events to the current frame
   232      * or caller frames. A {@code depth} value of {@link com.sun.jdi.request.StepRequest#STEP_OUT}
   243      * or caller frames. A {@code depth} value of {@link StepRequest#STEP_OUT}
   233      * restricts step events to caller frames only. All depth
   244      * restricts step events to caller frames only. All depth
   234      * restrictions are relative to the call stack immediately before the
   245      * restrictions are relative to the call stack immediately before the
   235      * step takes place.
   246      * step takes place.
   236      * <p>
   247      * <p>
   237      * Only one pending step request is allowed per thread.
   248      * Only one pending step request is allowed per thread.
   325      * EventRequestManager.
   336      * EventRequestManager.
   326      * Use {@link EventRequest#enable()} to
   337      * Use {@link EventRequest#enable()} to
   327      * activate this event request.
   338      * activate this event request.
   328      * <P>
   339      * <P>
   329      * This request (if enabled) will cause a
   340      * This request (if enabled) will cause a
   330      * {@link com.sun.jdi.event.VMDeathEvent}
   341      * {@link VMDeathEvent}
   331      * to be sent on termination of the target VM.
   342      * to be sent on termination of the target VM.
   332      * <P>
   343      * <P>
   333      * A VMDeathRequest with a suspend policy of
   344      * A VMDeathRequest with a suspend policy of
   334      * {@link EventRequest#SUSPEND_ALL SUSPEND_ALL}
   345      * {@link EventRequest#SUSPEND_ALL SUSPEND_ALL}
   335      * can be used to assure processing of incoming
   346      * can be used to assure processing of incoming
   336      * {@link EventRequest#SUSPEND_NONE SUSPEND_NONE} or
   347      * {@link EventRequest#SUSPEND_NONE SUSPEND_NONE} or
   337      * {@link EventRequest#SUSPEND_EVENT_THREAD SUSPEND_EVENT_THREAD}
   348      * {@link EventRequest#SUSPEND_EVENT_THREAD SUSPEND_EVENT_THREAD}
   338      * events before VM death.  If all event processing is being
   349      * events before VM death.  If all event processing is being
   339      * done in the same thread as event sets are being read,
   350      * done in the same thread as event sets are being read,
   340      * enabling the request is all that is needed since the VM
   351      * enabling the request is all that is needed since the VM
   341      * will be suspended until the {@link com.sun.jdi.event.EventSet}
   352      * will be suspended until the {@link EventSet}
   342      * containing the {@link com.sun.jdi.event.VMDeathEvent}
   353      * containing the {@link VMDeathEvent}
   343      * is resumed.
   354      * is resumed.
   344      * <P>
   355      * <P>
   345      * Not all target virtual machines support this operation.
   356      * Not all target virtual machines support this operation.
   346      * Use {@link VirtualMachine#canRequestVMDeathEvent()}
   357      * Use {@link VirtualMachine#canRequestVMDeathEvent()}
   347      * to determine if the operation is supported.
   358      * to determine if the operation is supported.