1 11 package org.eclipse.jdi.internal.request; 12 13 14 import java.io.ByteArrayOutputStream ; 15 import java.io.DataInputStream ; 16 import java.io.DataOutputStream ; 17 import java.io.IOException ; 18 19 import org.eclipse.jdi.internal.VirtualMachineImpl; 20 import org.eclipse.jdi.internal.event.EventImpl; 21 import org.eclipse.jdi.internal.jdwp.JdwpCommandPacket; 22 import org.eclipse.jdi.internal.jdwp.JdwpReplyPacket; 23 24 29 30 public class ReenterStepRequestImpl extends StepRequestImpl implements org.eclipse.jdi.hcr.ReenterStepRequest { 31 34 public ReenterStepRequestImpl(VirtualMachineImpl vmImpl) { 35 super("ReenterStepRequest", vmImpl); } 37 38 41 public int threadStepDepthJDWP(int threadStepDepth) { 42 return STEP_DEPTH_REENTER_JDWP_HCR; 43 } 44 45 48 public void enable() { 49 if (isEnabled()) 50 return; 51 52 initJdwpRequest(); 53 try { 54 ByteArrayOutputStream outBytes = new ByteArrayOutputStream (); 55 DataOutputStream outData = new DataOutputStream (outBytes); 56 writeByte(eventKind(), "event kind", EventImpl.eventKindMap(), outData); writeByte(suspendPolicyJDWP(), "suspend policy", outData); writeInt(modifierCount(), "modifiers", outData); writeModifiers(outData); 60 61 JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.HCR_REENTER_ON_EXIT, outBytes); 62 defaultReplyErrorHandler(replyPacket.errorCode()); 63 DataInputStream replyData = replyPacket.dataInStream(); 64 fRequestID = RequestID.read(this, replyData); 65 virtualMachineImpl().eventRequestManagerImpl().addRequestIDMapping(this); 66 } catch (IOException e) { 67 defaultIOExceptionHandler(e); 68 } finally { 69 handledJdwpRequest(); 70 } 71 } 72 } 73 | Popular Tags |