Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/tools/jdi/EventRequestManagerImpl.java
38920 views
/*1* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.tools.jdi;2627import com.sun.jdi.*;28import com.sun.jdi.request.*;29import com.sun.tools.jdi.JDWP;3031import java.util.*;3233/**34* This interface is used to create and remove Breakpoints, Watchpoints,35* etc.36* It include implementations of all the request interfaces..37*/38// Warnings from List filters and List[] requestLists is hard to fix.39// Remove SuppressWarning when we fix the warnings from List filters40// and List[] requestLists. The generic array is not supported.41@SuppressWarnings("unchecked")42class EventRequestManagerImpl extends MirrorImpl43implements EventRequestManager44{45List<? extends EventRequest>[] requestLists;46private static int methodExitEventCmd = 0;4748static int JDWPtoJDISuspendPolicy(byte jdwpPolicy) {49switch(jdwpPolicy) {50case JDWP.SuspendPolicy.ALL:51return EventRequest.SUSPEND_ALL;52case JDWP.SuspendPolicy.EVENT_THREAD:53return EventRequest.SUSPEND_EVENT_THREAD;54case JDWP.SuspendPolicy.NONE:55return EventRequest.SUSPEND_NONE;56default:57throw new IllegalArgumentException("Illegal policy constant: " + jdwpPolicy);58}59}6061static byte JDItoJDWPSuspendPolicy(int jdiPolicy) {62switch(jdiPolicy) {63case EventRequest.SUSPEND_ALL:64return JDWP.SuspendPolicy.ALL;65case EventRequest.SUSPEND_EVENT_THREAD:66return JDWP.SuspendPolicy.EVENT_THREAD;67case EventRequest.SUSPEND_NONE:68return JDWP.SuspendPolicy.NONE;69default:70throw new IllegalArgumentException("Illegal policy constant: " + jdiPolicy);71}72}7374/*75* Override superclass back to default equality76*/77public boolean equals(Object obj) {78return this == obj;79}8081public int hashCode() {82return System.identityHashCode(this);83}8485abstract class EventRequestImpl extends MirrorImpl implements EventRequest {86int id;8788/*89* This list is not protected by a synchronized wrapper. All90* access/modification should be protected by synchronizing on91* the enclosing instance of EventRequestImpl.92*/93List<Object> filters = new ArrayList<>();9495boolean isEnabled = false;96boolean deleted = false;97byte suspendPolicy = JDWP.SuspendPolicy.ALL;98private Map<Object, Object> clientProperties = null;99100EventRequestImpl() {101super(EventRequestManagerImpl.this.vm);102}103104105/*106* Override superclass back to default equality107*/108public boolean equals(Object obj) {109return this == obj;110}111112public int hashCode() {113return System.identityHashCode(this);114}115116abstract int eventCmd();117118InvalidRequestStateException invalidState() {119return new InvalidRequestStateException(toString());120}121122String state() {123return deleted? " (deleted)" :124(isEnabled()? " (enabled)" : " (disabled)");125}126127/**128* @return all the event request of this kind129*/130List requestList() {131return EventRequestManagerImpl.this.requestList(eventCmd());132}133134/**135* delete the event request136*/137void delete() {138if (!deleted) {139requestList().remove(this);140disable(); /* must do BEFORE delete */141deleted = true;142}143}144145public boolean isEnabled() {146return isEnabled;147}148149public void enable() {150setEnabled(true);151}152153public void disable() {154setEnabled(false);155}156157public synchronized void setEnabled(boolean val) {158if (deleted) {159throw invalidState();160} else {161if (val != isEnabled) {162if (isEnabled) {163clear();164} else {165set();166}167}168}169}170171public synchronized void addCountFilter(int count) {172if (isEnabled() || deleted) {173throw invalidState();174}175if (count < 1) {176throw new IllegalArgumentException("count is less than one");177}178filters.add(JDWP.EventRequest.Set.Modifier.Count.create(count));179}180181public void setSuspendPolicy(int policy) {182if (isEnabled() || deleted) {183throw invalidState();184}185suspendPolicy = JDItoJDWPSuspendPolicy(policy);186}187188public int suspendPolicy() {189return JDWPtoJDISuspendPolicy(suspendPolicy);190}191192/**193* set (enable) the event request194*/195synchronized void set() {196JDWP.EventRequest.Set.Modifier[] mods =197filters.toArray(198new JDWP.EventRequest.Set.Modifier[filters.size()]);199try {200id = JDWP.EventRequest.Set.process(vm, (byte)eventCmd(),201suspendPolicy, mods).requestID;202} catch (JDWPException exc) {203throw exc.toJDIException();204}205isEnabled = true;206}207208synchronized void clear() {209try {210JDWP.EventRequest.Clear.process(vm, (byte)eventCmd(), id);211} catch (JDWPException exc) {212throw exc.toJDIException();213}214isEnabled = false;215}216217/**218* @return a small Map219* @see #putProperty220* @see #getProperty221*/222private Map<Object, Object> getProperties() {223if (clientProperties == null) {224clientProperties = new HashMap<Object, Object>(2);225}226return clientProperties;227}228229/**230* Returns the value of the property with the specified key. Only231* properties added with <code>putProperty</code> will return232* a non-null value.233*234* @return the value of this property or null235* @see #putProperty236*/237public final Object getProperty(Object key) {238if (clientProperties == null) {239return null;240} else {241return getProperties().get(key);242}243}244245/**246* Add an arbitrary key/value "property" to this component.247*248* @see #getProperty249*/250public final void putProperty(Object key, Object value) {251if (value != null) {252getProperties().put(key, value);253} else {254getProperties().remove(key);255}256}257}258259abstract class ThreadVisibleEventRequestImpl extends EventRequestImpl {260public synchronized void addThreadFilter(ThreadReference thread) {261validateMirror(thread);262if (isEnabled() || deleted) {263throw invalidState();264}265filters.add(JDWP.EventRequest.Set.Modifier.ThreadOnly266.create((ThreadReferenceImpl)thread));267}268}269270abstract class ClassVisibleEventRequestImpl271extends ThreadVisibleEventRequestImpl {272public synchronized void addClassFilter(ReferenceType clazz) {273validateMirror(clazz);274if (isEnabled() || deleted) {275throw invalidState();276}277filters.add(JDWP.EventRequest.Set.Modifier.ClassOnly278.create((ReferenceTypeImpl)clazz));279}280281public synchronized void addClassFilter(String classPattern) {282if (isEnabled() || deleted) {283throw invalidState();284}285if (classPattern == null) {286throw new NullPointerException();287}288filters.add(JDWP.EventRequest.Set.Modifier.ClassMatch289.create(classPattern));290}291292public synchronized void addClassExclusionFilter(String classPattern) {293if (isEnabled() || deleted) {294throw invalidState();295}296if (classPattern == null) {297throw new NullPointerException();298}299filters.add(JDWP.EventRequest.Set.Modifier.ClassExclude300.create(classPattern));301}302303public synchronized void addInstanceFilter(ObjectReference instance) {304validateMirror(instance);305if (isEnabled() || deleted) {306throw invalidState();307}308if (!vm.canUseInstanceFilters()) {309throw new UnsupportedOperationException(310"target does not support instance filters");311}312filters.add(JDWP.EventRequest.Set.Modifier.InstanceOnly313.create((ObjectReferenceImpl)instance));314}315}316317class BreakpointRequestImpl extends ClassVisibleEventRequestImpl318implements BreakpointRequest {319private final Location location;320321BreakpointRequestImpl(Location location) {322this.location = location;323filters.add(0,JDWP.EventRequest.Set.Modifier.LocationOnly324.create(location));325requestList().add(this);326}327328public Location location() {329return location;330}331332int eventCmd() {333return JDWP.EventKind.BREAKPOINT;334}335336public String toString() {337return "breakpoint request " + location() + state();338}339}340341class ClassPrepareRequestImpl extends ClassVisibleEventRequestImpl342implements ClassPrepareRequest {343ClassPrepareRequestImpl() {344requestList().add(this);345}346347int eventCmd() {348return JDWP.EventKind.CLASS_PREPARE;349}350351public synchronized void addSourceNameFilter(String sourceNamePattern) {352if (isEnabled() || deleted) {353throw invalidState();354}355if (!vm.canUseSourceNameFilters()) {356throw new UnsupportedOperationException(357"target does not support source name filters");358}359if (sourceNamePattern == null) {360throw new NullPointerException();361}362363filters.add(JDWP.EventRequest.Set.Modifier.SourceNameMatch364.create(sourceNamePattern));365}366367public String toString() {368return "class prepare request " + state();369}370}371372class ClassUnloadRequestImpl extends ClassVisibleEventRequestImpl373implements ClassUnloadRequest {374ClassUnloadRequestImpl() {375requestList().add(this);376}377378int eventCmd() {379return JDWP.EventKind.CLASS_UNLOAD;380}381382public String toString() {383return "class unload request " + state();384}385}386387class ExceptionRequestImpl extends ClassVisibleEventRequestImpl388implements ExceptionRequest {389ReferenceType exception = null;390boolean caught = true;391boolean uncaught = true;392393ExceptionRequestImpl(ReferenceType refType,394boolean notifyCaught, boolean notifyUncaught) {395exception = refType;396caught = notifyCaught;397uncaught = notifyUncaught;398{399ReferenceTypeImpl exc;400if (exception == null) {401exc = new ClassTypeImpl(vm, 0);402} else {403exc = (ReferenceTypeImpl)exception;404}405filters.add(JDWP.EventRequest.Set.Modifier.ExceptionOnly.406create(exc, caught, uncaught));407}408requestList().add(this);409}410411public ReferenceType exception() {412return exception;413}414415public boolean notifyCaught() {416return caught;417}418419public boolean notifyUncaught() {420return uncaught;421}422423int eventCmd() {424return JDWP.EventKind.EXCEPTION;425}426427public String toString() {428return "exception request " + exception() + state();429}430}431432class MethodEntryRequestImpl extends ClassVisibleEventRequestImpl433implements MethodEntryRequest {434MethodEntryRequestImpl() {435requestList().add(this);436}437438int eventCmd() {439return JDWP.EventKind.METHOD_ENTRY;440}441442public String toString() {443return "method entry request " + state();444}445}446447class MethodExitRequestImpl extends ClassVisibleEventRequestImpl448implements MethodExitRequest {449MethodExitRequestImpl() {450if (methodExitEventCmd == 0) {451/*452* If we can get return values, then we always get them.453* Thus, for JDI MethodExitRequests, we always use the454* same JDWP EventKind. Here we decide which to use and455* save it so that it will be used for all future456* MethodExitRequests.457*458* This call to canGetMethodReturnValues can't459* be done in the EventRequestManager ctor because that is too early.460*/461if (vm.canGetMethodReturnValues()) {462methodExitEventCmd = JDWP.EventKind.METHOD_EXIT_WITH_RETURN_VALUE;463} else {464methodExitEventCmd = JDWP.EventKind.METHOD_EXIT;465}466}467requestList().add(this);468}469470int eventCmd() {471return EventRequestManagerImpl.methodExitEventCmd;472}473474public String toString() {475return "method exit request " + state();476}477}478479class MonitorContendedEnterRequestImpl extends ClassVisibleEventRequestImpl480implements MonitorContendedEnterRequest {481MonitorContendedEnterRequestImpl() {482requestList().add(this);483}484485int eventCmd() {486return JDWP.EventKind.MONITOR_CONTENDED_ENTER;487}488489public String toString() {490return "monitor contended enter request " + state();491}492}493494class MonitorContendedEnteredRequestImpl extends ClassVisibleEventRequestImpl495implements MonitorContendedEnteredRequest {496MonitorContendedEnteredRequestImpl() {497requestList().add(this);498}499500int eventCmd() {501return JDWP.EventKind.MONITOR_CONTENDED_ENTERED;502}503504public String toString() {505return "monitor contended entered request " + state();506}507}508509class MonitorWaitRequestImpl extends ClassVisibleEventRequestImpl510implements MonitorWaitRequest {511MonitorWaitRequestImpl() {512requestList().add(this);513}514515int eventCmd() {516return JDWP.EventKind.MONITOR_WAIT;517}518519public String toString() {520return "monitor wait request " + state();521}522}523524class MonitorWaitedRequestImpl extends ClassVisibleEventRequestImpl525implements MonitorWaitedRequest {526MonitorWaitedRequestImpl() {527requestList().add(this);528}529530int eventCmd() {531return JDWP.EventKind.MONITOR_WAITED;532}533534public String toString() {535return "monitor waited request " + state();536}537}538539class StepRequestImpl extends ClassVisibleEventRequestImpl540implements StepRequest {541ThreadReferenceImpl thread;542int size;543int depth;544545StepRequestImpl(ThreadReference thread, int size, int depth) {546this.thread = (ThreadReferenceImpl)thread;547this.size = size;548this.depth = depth;549550/*551* Translate size and depth to corresponding JDWP values.552*/553int jdwpSize;554switch (size) {555case STEP_MIN:556jdwpSize = JDWP.StepSize.MIN;557break;558case STEP_LINE:559jdwpSize = JDWP.StepSize.LINE;560break;561default:562throw new IllegalArgumentException("Invalid step size");563}564565int jdwpDepth;566switch (depth) {567case STEP_INTO:568jdwpDepth = JDWP.StepDepth.INTO;569break;570case STEP_OVER:571jdwpDepth = JDWP.StepDepth.OVER;572break;573case STEP_OUT:574jdwpDepth = JDWP.StepDepth.OUT;575break;576default:577throw new IllegalArgumentException("Invalid step depth");578}579580/*581* Make sure this isn't a duplicate582*/583List<StepRequest> requests = stepRequests();584Iterator<StepRequest> iter = requests.iterator();585while (iter.hasNext()) {586StepRequest request = iter.next();587if ((request != this) &&588request.isEnabled() &&589request.thread().equals(thread)) {590throw new DuplicateRequestException(591"Only one step request allowed per thread");592}593}594595filters.add(JDWP.EventRequest.Set.Modifier.Step.596create(this.thread, jdwpSize, jdwpDepth));597requestList().add(this);598599}600public int depth() {601return depth;602}603604public int size() {605return size;606}607608public ThreadReference thread() {609return thread;610}611612int eventCmd() {613return JDWP.EventKind.SINGLE_STEP;614}615616public String toString() {617return "step request " + thread() + state();618}619}620621class ThreadDeathRequestImpl extends ThreadVisibleEventRequestImpl622implements ThreadDeathRequest {623ThreadDeathRequestImpl() {624requestList().add(this);625}626627int eventCmd() {628return JDWP.EventKind.THREAD_DEATH;629}630631public String toString() {632return "thread death request " + state();633}634}635636class ThreadStartRequestImpl extends ThreadVisibleEventRequestImpl637implements ThreadStartRequest {638ThreadStartRequestImpl() {639requestList().add(this);640}641642int eventCmd() {643return JDWP.EventKind.THREAD_START;644}645646public String toString() {647return "thread start request " + state();648}649}650651abstract class WatchpointRequestImpl extends ClassVisibleEventRequestImpl652implements WatchpointRequest {653final Field field;654655WatchpointRequestImpl(Field field) {656this.field = field;657filters.add(0,658JDWP.EventRequest.Set.Modifier.FieldOnly.create(659(ReferenceTypeImpl)field.declaringType(),660((FieldImpl)field).ref()));661}662663public Field field() {664return field;665}666}667668class AccessWatchpointRequestImpl extends WatchpointRequestImpl669implements AccessWatchpointRequest {670AccessWatchpointRequestImpl(Field field) {671super(field);672requestList().add(this);673}674675int eventCmd() {676return JDWP.EventKind.FIELD_ACCESS;677}678679public String toString() {680return "access watchpoint request " + field + state();681}682}683684class ModificationWatchpointRequestImpl extends WatchpointRequestImpl685implements ModificationWatchpointRequest {686ModificationWatchpointRequestImpl(Field field) {687super(field);688requestList().add(this);689}690691int eventCmd() {692return JDWP.EventKind.FIELD_MODIFICATION;693}694695public String toString() {696return "modification watchpoint request " + field + state();697}698}699700class VMDeathRequestImpl extends EventRequestImpl701implements VMDeathRequest {702VMDeathRequestImpl() {703requestList().add(this);704}705706int eventCmd() {707return JDWP.EventKind.VM_DEATH;708}709710public String toString() {711return "VM death request " + state();712}713}714715/**716* Constructor.717*/718EventRequestManagerImpl(VirtualMachine vm) {719super(vm);720java.lang.reflect.Field[] ekinds =721JDWP.EventKind.class.getDeclaredFields();722int highest = 0;723for (int i = 0; i < ekinds.length; ++i) {724int val;725try {726val = ekinds[i].getInt(null);727} catch (IllegalAccessException exc) {728throw new RuntimeException("Got: " + exc);729}730if (val > highest) {731highest = val;732}733}734requestLists = new List[highest+1];735for (int i=0; i <= highest; i++) {736requestLists[i] = new ArrayList<>();737}738}739740public ClassPrepareRequest createClassPrepareRequest() {741return new ClassPrepareRequestImpl();742}743744public ClassUnloadRequest createClassUnloadRequest() {745return new ClassUnloadRequestImpl();746}747748public ExceptionRequest createExceptionRequest(ReferenceType refType,749boolean notifyCaught,750boolean notifyUncaught) {751validateMirrorOrNull(refType);752return new ExceptionRequestImpl(refType, notifyCaught, notifyUncaught);753}754755public StepRequest createStepRequest(ThreadReference thread,756int size, int depth) {757validateMirror(thread);758return new StepRequestImpl(thread, size, depth);759}760761public ThreadDeathRequest createThreadDeathRequest() {762return new ThreadDeathRequestImpl();763}764765public ThreadStartRequest createThreadStartRequest() {766return new ThreadStartRequestImpl();767}768769public MethodEntryRequest createMethodEntryRequest() {770return new MethodEntryRequestImpl();771}772773public MethodExitRequest createMethodExitRequest() {774return new MethodExitRequestImpl();775}776777public MonitorContendedEnterRequest createMonitorContendedEnterRequest() {778if (!vm.canRequestMonitorEvents()) {779throw new UnsupportedOperationException(780"target VM does not support requesting Monitor events");781}782return new MonitorContendedEnterRequestImpl();783}784785public MonitorContendedEnteredRequest createMonitorContendedEnteredRequest() {786if (!vm.canRequestMonitorEvents()) {787throw new UnsupportedOperationException(788"target VM does not support requesting Monitor events");789}790return new MonitorContendedEnteredRequestImpl();791}792793public MonitorWaitRequest createMonitorWaitRequest() {794if (!vm.canRequestMonitorEvents()) {795throw new UnsupportedOperationException(796"target VM does not support requesting Monitor events");797}798return new MonitorWaitRequestImpl();799}800801public MonitorWaitedRequest createMonitorWaitedRequest() {802if (!vm.canRequestMonitorEvents()) {803throw new UnsupportedOperationException(804"target VM does not support requesting Monitor events");805}806return new MonitorWaitedRequestImpl();807}808809public BreakpointRequest createBreakpointRequest(Location location) {810validateMirror(location);811if (location.codeIndex() == -1) {812throw new NativeMethodException("Cannot set breakpoints on native methods");813}814return new BreakpointRequestImpl(location);815}816817public AccessWatchpointRequest818createAccessWatchpointRequest(Field field) {819validateMirror(field);820if (!vm.canWatchFieldAccess()) {821throw new UnsupportedOperationException(822"target VM does not support access watchpoints");823}824return new AccessWatchpointRequestImpl(field);825}826827public ModificationWatchpointRequest828createModificationWatchpointRequest(Field field) {829validateMirror(field);830if (!vm.canWatchFieldModification()) {831throw new UnsupportedOperationException(832"target VM does not support modification watchpoints");833}834return new ModificationWatchpointRequestImpl(field);835}836837public VMDeathRequest createVMDeathRequest() {838if (!vm.canRequestVMDeathEvent()) {839throw new UnsupportedOperationException(840"target VM does not support requesting VM death events");841}842return new VMDeathRequestImpl();843}844845public void deleteEventRequest(EventRequest eventRequest) {846validateMirror(eventRequest);847((EventRequestImpl)eventRequest).delete();848}849850public void deleteEventRequests(List<? extends EventRequest> eventRequests) {851validateMirrors(eventRequests);852// copy the eventRequests to avoid ConcurrentModificationException853Iterator<? extends EventRequest> iter = (new ArrayList<>(eventRequests)).iterator();854while (iter.hasNext()) {855((EventRequestImpl)iter.next()).delete();856}857}858859public void deleteAllBreakpoints() {860requestList(JDWP.EventKind.BREAKPOINT).clear();861862try {863JDWP.EventRequest.ClearAllBreakpoints.process(vm);864} catch (JDWPException exc) {865throw exc.toJDIException();866}867}868869public List<StepRequest> stepRequests() {870return (List<StepRequest>)unmodifiableRequestList(JDWP.EventKind.SINGLE_STEP);871}872873public List<ClassPrepareRequest> classPrepareRequests() {874return (List<ClassPrepareRequest>)unmodifiableRequestList(JDWP.EventKind.CLASS_PREPARE);875}876877public List<ClassUnloadRequest> classUnloadRequests() {878return (List<ClassUnloadRequest>)unmodifiableRequestList(JDWP.EventKind.CLASS_UNLOAD);879}880881public List<ThreadStartRequest> threadStartRequests() {882return (List<ThreadStartRequest>)unmodifiableRequestList(JDWP.EventKind.THREAD_START);883}884885public List<ThreadDeathRequest> threadDeathRequests() {886return (List<ThreadDeathRequest>)unmodifiableRequestList(JDWP.EventKind.THREAD_DEATH);887}888889public List<ExceptionRequest> exceptionRequests() {890return (List<ExceptionRequest>)unmodifiableRequestList(JDWP.EventKind.EXCEPTION);891}892893public List<BreakpointRequest> breakpointRequests() {894return (List<BreakpointRequest>)unmodifiableRequestList(JDWP.EventKind.BREAKPOINT);895}896897public List<AccessWatchpointRequest> accessWatchpointRequests() {898return (List<AccessWatchpointRequest>)unmodifiableRequestList(JDWP.EventKind.FIELD_ACCESS);899}900901public List<ModificationWatchpointRequest> modificationWatchpointRequests() {902return (List<ModificationWatchpointRequest>)unmodifiableRequestList(JDWP.EventKind.FIELD_MODIFICATION);903}904905public List<MethodEntryRequest> methodEntryRequests() {906return (List<MethodEntryRequest>)unmodifiableRequestList(JDWP.EventKind.METHOD_ENTRY);907}908909public List<MethodExitRequest> methodExitRequests() {910return (List<MethodExitRequest>)unmodifiableRequestList(911EventRequestManagerImpl.methodExitEventCmd);912}913914public List<MonitorContendedEnterRequest> monitorContendedEnterRequests() {915return (List<MonitorContendedEnterRequest>)unmodifiableRequestList(JDWP.EventKind.MONITOR_CONTENDED_ENTER);916}917918public List<MonitorContendedEnteredRequest> monitorContendedEnteredRequests() {919return (List<MonitorContendedEnteredRequest>)unmodifiableRequestList(JDWP.EventKind.MONITOR_CONTENDED_ENTERED);920}921922public List<MonitorWaitRequest> monitorWaitRequests() {923return (List<MonitorWaitRequest>)unmodifiableRequestList(JDWP.EventKind.MONITOR_WAIT);924}925926public List<MonitorWaitedRequest> monitorWaitedRequests() {927return (List<MonitorWaitedRequest>)unmodifiableRequestList(JDWP.EventKind.MONITOR_WAITED);928}929930public List<VMDeathRequest> vmDeathRequests() {931return (List<VMDeathRequest>)unmodifiableRequestList(JDWP.EventKind.VM_DEATH);932}933934List<? extends EventRequest> unmodifiableRequestList(int eventCmd) {935return Collections.unmodifiableList(requestList(eventCmd));936}937938EventRequest request(int eventCmd, int requestId) {939List<? extends EventRequest> rl = requestList(eventCmd);940for (int i = rl.size() - 1; i >= 0; i--) {941EventRequestImpl er = (EventRequestImpl)rl.get(i);942if (er.id == requestId) {943return er;944}945}946return null;947}948949List<? extends EventRequest> requestList(int eventCmd) {950return requestLists[eventCmd];951}952953}954955956