1 22 23 package org.aspectj.debugger.request; 24 25 import org.aspectj.debugger.base.*; 26 27 import com.sun.jdi.*; 28 import com.sun.jdi.event.*; 29 import com.sun.jdi.request.*; 30 import java.util.*; 31 32 40 41 public abstract class WatchRequest extends ClassAndFieldNeedingRequestAction { 42 43 public final static int ACCESS = 0x01; 44 public final static int ALL = 0x10; 45 46 public WatchRequest(Debugger debugger, String className, String fieldName) { 47 super(debugger, className, fieldName); 48 } 49 50 EventRequest resolve(ReferenceType refType) throws MultipleLocationsException { 51 EventRequest request = null; 52 try { 53 if (refType.name().equals(className)) { 54 if (getType() == ALL) { 55 request = vm().eventRequestManager().createModificationWatchpointRequest(getField()); 56 } else { 57 request = vm().eventRequestManager().createAccessWatchpointRequest(getField()); 58 } 59 request.enable(); 61 request.setSuspendPolicy(EventRequest.SUSPEND_ALL); 62 } 63 } catch (NoVMException e) { 64 } catch (DebuggerException de) { 65 } 67 return request; 68 } 69 70 abstract int getType(); 71 } 72 | Popular Tags |