1 11 package org.eclipse.jdi.internal.event; 12 13 14 import java.io.DataInputStream ; 15 import java.io.IOException ; 16 17 import org.eclipse.jdi.internal.FieldImpl; 18 import org.eclipse.jdi.internal.MirrorImpl; 19 import org.eclipse.jdi.internal.ObjectReferenceImpl; 20 import org.eclipse.jdi.internal.VirtualMachineImpl; 21 import org.eclipse.jdi.internal.request.RequestID; 22 23 import com.sun.jdi.Field; 24 import com.sun.jdi.ObjectReference; 25 import com.sun.jdi.Value; 26 import com.sun.jdi.event.WatchpointEvent; 27 28 34 public abstract class WatchpointEventImpl extends LocatableEventImpl implements WatchpointEvent { 35 36 protected FieldImpl fField; 37 38 protected ObjectReferenceImpl fObjectReference; 39 40 43 protected WatchpointEventImpl(String description, VirtualMachineImpl vmImpl, RequestID requestID) { 44 super(description, vmImpl, requestID); 45 } 46 47 50 public void readWatchpointEventFields(MirrorImpl target, DataInputStream dataInStream) throws IOException { 51 readThreadAndLocation(target, dataInStream); 52 fField = FieldImpl.readWithReferenceTypeWithTag(target, dataInStream); 53 fObjectReference = ObjectReferenceImpl.readObjectRefWithTag(target, dataInStream); 54 } 55 56 59 public Field field() { 60 return fField; 61 } 62 63 66 public ObjectReference object() { 67 return fObjectReference; 68 } 69 70 73 public Value valueCurrent() { 74 if (fObjectReference == null) 76 return fField.declaringType().getValue(fField); 77 return fObjectReference.getValue(fField); 78 } 79 } 80 | Popular Tags |