Examples of JdwpReplyPacket


Examples of org.eclipse.jdi.internal.jdwp.JdwpReplyPacket

      writeInt(size, "size", outData); //$NON-NLS-1$
      for (int i = 0; i < size; i++) {
        ((ReferenceTypeImpl) refTypes.get(i)).getRefTypeID().write(
            outData);
      }
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.VM_INSTANCE_COUNTS, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_CLASS:
      case JdwpReplyPacket.INVALID_OBJECT:
        throw new ObjectCollectedException(
            JDIMessages.class_or_object_not_known);
      case JdwpReplyPacket.ILLEGAL_ARGUMENT:
        throw new IllegalArgumentException(
            JDIMessages.VirtualMachineImpl_count_less_than_zero);
      case JdwpReplyPacket.NOT_IMPLEMENTED:
        throw new UnsupportedOperationException(
            JDIMessages.ReferenceTypeImpl_27);
      case JdwpReplyPacket.VM_DEAD:
        throw new VMDisconnectedException(JDIMessages.vm_dead);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      int counts = readInt("counts", replyData); //$NON-NLS-1$
      if (counts != size) {
        throw new InternalError(JDIMessages.VirtualMachineImpl_3);
      }
      long[] ret = new long[counts];
View Full Code Here

Examples of org.eclipse.jdi.internal.jdwp.JdwpReplyPacket

   */
  public List<ReferenceType> visibleClasses() {
    // Note that this information should not be cached.
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.CLR_VISIBLE_CLASSES, this);
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
      List<ReferenceType> elements = new ArrayList<ReferenceType>(nrOfElements);
      for (int i = 0; i < nrOfElements; i++) {
        ReferenceTypeImpl elt = ReferenceTypeImpl.readWithTypeTag(this, replyData);
        if (elt == null)
View Full Code Here

Examples of org.eclipse.jdi.internal.jdwp.JdwpReplyPacket

  /**
   * @return Returns a specified Reply Packet from the Virtual Machine.
   */
  public JdwpReplyPacket getReply(int id, long timeToWait) {
    JdwpReplyPacket packet = null;
    long remainingTime = timeToWait;
    synchronized (fReplyPackets) {
      final long timeBeforeWait = System.currentTimeMillis();
      // Wait until reply is available.
      while (!VMIsDisconnected() && remainingTime > 0) {
View Full Code Here

Examples of org.eclipse.jdi.internal.jdwp.JdwpReplyPacket

   * @return Returns a specified reply packet from the reply packet list.
   */
  private JdwpReplyPacket removeReplyPacket(int id) {
    ListIterator<JdwpReplyPacket> iter = fReplyPackets.listIterator();
    while (iter.hasNext()) {
      JdwpReplyPacket packet = iter.next();
      if (packet.getId() == id) {
        iter.remove();
        return packet;
      }
    }
    return null;
View Full Code Here

Examples of org.eclipse.jdi.internal.jdwp.JdwpReplyPacket

    long sent = System.currentTimeMillis();
    fVirtualMachineImpl.packetSendManager().sendPacket(commandPacket);
    fPendingJdwpRequest = true;
    writeVerboseCommandPacketHeader(commandPacket);

    JdwpReplyPacket reply = fVirtualMachineImpl.packetReceiveManager()
        .getReply(commandPacket);
    long recieved = System.currentTimeMillis();
    if (JDIDebugOptions.DEBUG_JDI_REQUEST_TIMES) {
      StringBuffer buf = new StringBuffer();
      buf.append(JDIDebugOptions.FORMAT.format(new Date(sent)));
      buf.append(" JDI Request: "); //$NON-NLS-1$
      buf.append(commandPacket.toString());
      buf.append("\n\tResponse Time: "); //$NON-NLS-1$
      buf.append(recieved - sent);
      buf.append("ms"); //$NON-NLS-1$
      buf.append(" length: "); //$NON-NLS-1$
      buf.append(reply.getLength());
      JDIDebugOptions.trace(buf.toString());
    }
    if (fVerboseWriter != null) {
      fVerboseWriter.println();
      fVerboseWriter.println("Received reply"); //$NON-NLS-1$
      fVerboseWriter.println("length", reply.getLength()); //$NON-NLS-1$
      fVerboseWriter.println("id", reply.getId()); //$NON-NLS-1$
      fVerboseWriter.println(
          "flags", reply.getFlags(), JdwpPacket.getFlagMap()); //$NON-NLS-1$
      fVerboseWriter
          .println(
              "error code", reply.errorCode(), JdwpReplyPacket.errorMap()); //$NON-NLS-1$
    }

    return reply;
  }
View Full Code Here

Examples of org.eclipse.jdi.internal.jdwp.JdwpReplyPacket

   * Prevents garbage collection for this object.
   */
  public void disableCollection() {
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.OR_DISABLE_COLLECTION, this);
      defaultReplyErrorHandler(replyPacket.errorCode());
    } finally {
      handledJdwpRequest();
    }
  }
View Full Code Here

Examples of org.eclipse.jdi.internal.jdwp.JdwpReplyPacket

   * Permits garbage collection for this object.
   */
  public void enableCollection() {
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.OR_ENABLE_COLLECTION, this);
      defaultReplyErrorHandler(replyPacket.errorCode());
    } finally {
      handledJdwpRequest();
    }
  }
View Full Code Here

Examples of org.eclipse.jdi.internal.jdwp.JdwpReplyPacket

      throw new UnsupportedOperationException();
    }
    // Note that this information should not be cached.
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.OR_MONITOR_INFO, this);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new IncompatibleThreadStateException();
      case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
        throw new IncompatibleThreadStateException();
      }

      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      MonitorInfo result = new MonitorInfo();
      result.owner = ThreadReferenceImpl.read(this, replyData);
      result.entryCount = readInt("entry count", replyData); //$NON-NLS-1$
      int nrOfWaiters = readInt("nr of waiters", replyData); //$NON-NLS-1$
      result.waiters = new ArrayList<ThreadReference>(nrOfWaiters);
View Full Code Here

Examples of org.eclipse.jdi.internal.jdwp.JdwpReplyPacket

      ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
      DataOutputStream outData = new DataOutputStream(outBytes);
      this.getObjectID().write(outData);
      writeInt(max, "max referrers", outData); //$NON-NLS-1$

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.OR_REFERRING_OBJECTS, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.NOT_IMPLEMENTED:
        throw new UnsupportedOperationException(
            JDIMessages.ReferenceTypeImpl_27);
      case JdwpReplyPacket.ILLEGAL_ARGUMENT:
        throw new IllegalArgumentException(
            JDIMessages.ReferenceTypeImpl_26);
      case JdwpReplyPacket.INVALID_OBJECT:
        throw new ObjectCollectedException(
            JDIMessages.ObjectReferenceImpl_object_not_known);
      case JdwpReplyPacket.VM_DEAD:
        throw new VMDisconnectedException(JDIMessages.vm_dead);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      int elements = readInt("elements", replyData); //$NON-NLS-1$
      if (max > 0 && elements > max) {
        elements = max;
      }
      ArrayList<Value> list = new ArrayList<Value>();
View Full Code Here

Examples of org.eclipse.jdi.internal.jdwp.JdwpReplyPacket

      for (int i = 0; i < nonStaticFieldsSize; i++) {
        FieldImpl field = nonStaticFields.get(i);
        field.write(this, outData);
      }

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.OR_GET_VALUES, outBytes);
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
      if (nrOfElements != nonStaticFieldsSize)
        throw new InternalError(
            JDIMessages.ObjectReferenceImpl_Retrieved_a_different_number_of_values_from_the_VM_than_requested_1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.