J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 1998-2001 Sun Microsystems, Inc. All Rights Reserved. |
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 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 |
| 7 | * published by the Free Software Foundation. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun in the LICENSE file that accompanied this code. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | * accompanied this code). |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License version |
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any questions. |
| 24 | */ |
| 25 | |
| 26 | package com.sun.jdi.request; |
| 27 | |
| 28 | import com.sun.jdi.*; |
| 29 | |
| 30 | /** |
| 31 | * Request for notification when a step occurs in the target VM. |
| 32 | * When an enabled StepRequest is satisfied, an |
| 33 | * {@link com.sun.jdi.event.EventSet event set} containing a |
| 34 | * {@link com.sun.jdi.event.StepEvent StepEvent} will be placed on the |
| 35 | * {@link com.sun.jdi.event.EventQueue EventQueue}. |
| 36 | * The collection of existing StepRequests is |
| 37 | * managed by the {@link EventRequestManager} |
| 38 | * |
| 39 | * @see com.sun.jdi.event.StepEvent |
| 40 | * @see com.sun.jdi.event.EventQueue |
| 41 | * @see EventRequestManager |
| 42 | * |
| 43 | * @author Robert Field |
| 44 | * @since 1.3 |
| 45 | */ |
| 46 | public interface StepRequest extends EventRequest { |
| 47 | |
| 48 | /** Step into any newly pushed frames */ |
| 49 | int STEP_INTO = 1; |
| 50 | /** Step over any newly pushed frames */ |
| 51 | int STEP_OVER = 2; |
| 52 | /** Step out of the current frame */ |
| 53 | int STEP_OUT = 3; |
| 54 | |
| 55 | /** Step to the next available location */ |
| 56 | int STEP_MIN = -1; |
| 57 | /** Step to the next location on a different line */ |
| 58 | int STEP_LINE = -2; |
| 59 | |
| 60 | /** |
| 61 | * @return the thread on which the step event is being requested. |
| 62 | */ |
| 63 | ThreadReference thread(); |
| 64 | |
| 65 | /** |
| 66 | * @return the step size |
| 67 | */ |
| 68 | int size(); |
| 69 | |
| 70 | /** |
| 71 | * @return the step depth |
| 72 | */ |
| 73 | int depth(); |
| 74 | |
| 75 | /** |
| 76 | * Restricts the events generated by this request to those whose |
| 77 | * location is in the given reference type or any of its subtypes. |
| 78 | * An event will be generated for any location in a reference type |
| 79 | * that can be safely cast to the given reference type. |
| 80 | * |
| 81 | * @param refType the reference type to filter on. |
| 82 | * @throws InvalidRequestStateException if this request is currently |
| 83 | * enabled or has been deleted. |
| 84 | * Filters may be added only to disabled requests. |
| 85 | */ |
| 86 | void addClassFilter(ReferenceType refType); |
| 87 | |
| 88 | /** |
| 89 | * Restricts the events generated by this request to those |
| 90 | * whose location is in a class whose name matches a restricted |
| 91 | * regular expression. Regular expressions are limited |
| 92 | * to exact matches and patterns that begin with '*' or end with '*'; |
| 93 | * for example, "*.Foo" or "java.*". |
| 94 | * |
| 95 | * @param classPattern the pattern String to filter for. |
| 96 | * @throws InvalidRequestStateException if this request is currently |
| 97 | * enabled or has been deleted. |
| 98 | * Filters may be added only to disabled requests. |
| 99 | */ |
| 100 | void addClassFilter(String classPattern); |
| 101 | |
| 102 | /** |
| 103 | * Restricts the events generated by this request to those |
| 104 | * whose location is in a class whose name does <b>not</b> match a |
| 105 | * restricted regular expression. Regular expressions are limited |
| 106 | * to exact matches and patterns that begin with '*' or end with '*'; |
| 107 | * for example, "*.Foo" or "java.*". |
| 108 | * |
| 109 | * @param classPattern the pattern String to filter against. |
| 110 | * @throws InvalidRequestStateException if this request is currently |
| 111 | * enabled or has been deleted. |
| 112 | * Filters may be added only to disabled requests. |
| 113 | */ |
| 114 | void addClassExclusionFilter(String classPattern); |
| 115 | |
| 116 | /** |
| 117 | * Restricts the events generated by this request to those in |
| 118 | * which the currently executing instance ("this") is the object |
| 119 | * specified. |
| 120 | * <P> |
| 121 | * Not all targets support this operation. |
| 122 | * Use {@link VirtualMachine#canUseInstanceFilters()} |
| 123 | * to determine if the operation is supported. |
| 124 | * @since 1.4 |
| 125 | * @param instance the object which must be the current instance |
| 126 | * in order to pass this filter. |
| 127 | * @throws java.lang.UnsupportedOperationException if |
| 128 | * the target virtual machine does not support this |
| 129 | * operation. |
| 130 | * @throws InvalidRequestStateException if this request is currently |
| 131 | * enabled or has been deleted. |
| 132 | * Filters may be added only to disabled requests. |
| 133 | */ |
| 134 | void addInstanceFilter(ObjectReference instance); |
| 135 | } |