1 7 34 35 package com.sun.tools.example.debug.tty; 36 37 import com.sun.jdi.*; 38 import com.sun.jdi.request.EventRequestManager; 39 import com.sun.jdi.request.EventRequest; 40 41 class ModificationWatchpointSpec extends WatchpointSpec { 42 ModificationWatchpointSpec(ReferenceTypeSpec refSpec, String fieldId) 43 throws MalformedMemberNameException { 44 super(refSpec, fieldId); 45 } 46 47 50 EventRequest resolveEventRequest(ReferenceType refType) 51 throws NoSuchFieldException { 52 Field field = refType.fieldByName(fieldId); 53 EventRequestManager em = refType.virtualMachine().eventRequestManager(); 54 EventRequest wp = em.createModificationWatchpointRequest(field); 55 wp.setSuspendPolicy(suspendPolicy); 56 wp.enable(); 57 return wp; 58 } 59 60 public String toString() { 61 return MessageOutput.format("watch modification of", 62 new Object [] {refSpec.toString(), 63 fieldId}); 64 } 65 } 66 67 68 | Popular Tags |