Package org.eclipse.jdi.internal.jdwp

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


    try {
      ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
      DataOutputStream outData = new DataOutputStream(outBytes);
      getRefTypeID().write(outData);

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.RT_CLASS_VERSION, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_CLASS:
      case JdwpReplyPacket.INVALID_OBJECT:
        throw new ObjectCollectedException(
            JDIMessages.class_or_object_not_known);
      case JdwpReplyPacket.ABSENT_INFORMATION:
        return 0;
      case JdwpReplyPacket.NOT_IMPLEMENTED:
        throw new UnsupportedOperationException(
            JDIMessages.ReferenceTypeImpl_no_class_version_support24);
      case JdwpReplyPacket.VM_DEAD:
        throw new VMDisconnectedException(JDIMessages.vm_dead);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      return readInt("major version", replyData); //$NON-NLS-1$
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
      return 0;
    } finally {
View Full Code Here


    try {
      ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
      DataOutputStream outData = new DataOutputStream(outBytes);
      getRefTypeID().write(outData);

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.RT_CLASS_VERSION, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_CLASS:
      case JdwpReplyPacket.INVALID_OBJECT:
        throw new ObjectCollectedException(
            JDIMessages.class_or_object_not_known);
      case JdwpReplyPacket.ABSENT_INFORMATION:
        return 0;
      case JdwpReplyPacket.NOT_IMPLEMENTED:
        throw new UnsupportedOperationException(
            JDIMessages.ReferenceTypeImpl_no_class_version_support24);
      case JdwpReplyPacket.VM_DEAD:
        throw new VMDisconnectedException(JDIMessages.vm_dead);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      readInt("major version", replyData); //$NON-NLS-1$
      return readInt("minor version", replyData); //$NON-NLS-1$
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
      return 0;
View Full Code Here

   * @since 3.3
   */
  public byte[] sendJDWPCommand(byte commandSet, byte commandId, byte[] data)
      throws IOException {
    int command = (256 * commandSet) + commandId;
    JdwpReplyPacket reply = ((VirtualMachineImpl) getVM()).requestVM(
        command, data);
    return reply.getPacketAsBytes();
  }
View Full Code Here

    try {
      ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
      DataOutputStream outData = new DataOutputStream(outBytes);
      this.getRefTypeID().write(outData);

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.RT_CONSTANT_POOL, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_CLASS:
      case JdwpReplyPacket.INVALID_OBJECT:
        throw new ObjectCollectedException(
            JDIMessages.class_or_object_not_known);
      case JdwpReplyPacket.ABSENT_INFORMATION:
        return 0;
      case JdwpReplyPacket.NOT_IMPLEMENTED:
        throw new UnsupportedOperationException(
            JDIMessages.ReferenceTypeImpl_no_constant_pool_support);
      case JdwpReplyPacket.VM_DEAD:
        throw new VMDisconnectedException(JDIMessages.vm_dead);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      return readInt("pool count", replyData); //$NON-NLS-1$
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
      return 0;
    } finally {
View Full Code Here

    try {
      ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
      DataOutputStream outData = new DataOutputStream(outBytes);
      this.getRefTypeID().write(outData);

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.RT_CONSTANT_POOL, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_CLASS:
      case JdwpReplyPacket.INVALID_OBJECT:
        throw new ObjectCollectedException(
            JDIMessages.class_or_object_not_known);
      case JdwpReplyPacket.ABSENT_INFORMATION:
        return new byte[0];
      case JdwpReplyPacket.NOT_IMPLEMENTED:
        throw new UnsupportedOperationException(
            JDIMessages.ReferenceTypeImpl_no_constant_pool_support);
      case JdwpReplyPacket.VM_DEAD:
        throw new VMDisconnectedException(JDIMessages.vm_dead);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      readInt("pool count", replyData); //$NON-NLS-1$
      int bytes = readInt("byte count", replyData); //$NON-NLS-1$
      byte[] array = new byte[bytes];
      for (int i = 0; i < bytes; i++) {
        array[i] = readByte("byte read", replyData); //$NON-NLS-1$
View Full Code Here

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

      DataInputStream replyData = replyPacket.dataInStream();
      ObjectReference result = ObjectReferenceImpl.readObjectRefWithTag(
          this, replyData);
      return result;
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
View Full Code Here

        ((ValueImpl) value).writeWithTag((ValueImpl) value,
            dataOutStream);
      } else {
        ValueImpl.writeNullWithTag(this, dataOutStream);
      }
      JdwpReplyPacket reply = requestVM(
          JdwpCommandPacket.TR_FORCE_EARLY_RETURN, byteOutStream);
      switch (reply.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new ObjectCollectedException(
            JDIMessages.ThreadReferenceImpl_thread_object_invalid);
      case JdwpReplyPacket.INVALID_OBJECT:
        throw new ClassNotLoadedException(
            JDIMessages.ThreadReferenceImpl_thread_or_value_unknown);
      case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
      case JdwpReplyPacket.THREAD_NOT_ALIVE:
        throw new IncompatibleThreadStateException(
            JDIMessages.ThreadReferenceImpl_thread_not_suspended);
      case JdwpReplyPacket.NOT_IMPLEMENTED:
        throw new UnsupportedOperationException(
            JDIMessages.ThreadReferenceImpl_no_force_early_return_on_threads);
      case JdwpReplyPacket.OPAQUE_FRAME:
        throw new NativeMethodException(
            JDIMessages.ThreadReferenceImpl_thread_cannot_force_native_method);
      case JdwpReplyPacket.NO_MORE_FRAMES:
        throw new InvalidStackFrameException(
            JDIMessages.ThreadReferenceImpl_thread_no_stackframes);
      case JdwpReplyPacket.TYPE_MISMATCH:
        throw new InvalidTypeException(
            JDIMessages.ThreadReferenceImpl_incapatible_return_type);
      case JdwpReplyPacket.VM_DEAD:
        throw new VMDisconnectedException(JDIMessages.vm_dead);
      }
      defaultReplyErrorHandler(reply.errorCode());
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
    } finally {
      handledJdwpRequest();
    }
View Full Code Here

   */
  public int frameCount() throws IncompatibleThreadStateException {
    // Note that this information should not be cached.
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.TR_FRAME_COUNT, this);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new ObjectCollectedException();
      case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
        throw new IncompatibleThreadStateException(
            JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_1);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      int result = readInt("frame count", replyData); //$NON-NLS-1$
      return result;
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
      return 0;
View Full Code Here

      DataOutputStream outData = new DataOutputStream(outBytes);
      write(this, outData);
      writeInt(start, "start", outData); //$NON-NLS-1$
      writeInt(length, "length", outData); //$NON-NLS-1$

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.TR_FRAMES, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new ObjectCollectedException();
      case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
        throw new IncompatibleThreadStateException(
            JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_1);
      case JdwpReplyPacket.INVALID_INDEX:
        throw new IndexOutOfBoundsException(
            JDIMessages.ThreadReferenceImpl_Invalid_index_of_stack_frames_given_4);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
      List<StackFrame> frames = new ArrayList<StackFrame>(nrOfElements);
      for (int i = 0; i < nrOfElements; i++) {
        StackFrameImpl frame = StackFrameImpl.readWithLocation(this,
            this, replyData);
View Full Code Here

   */
  public boolean isSuspended() {
    // Note that this information should not be cached.
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.TR_STATUS, this);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new ObjectCollectedException();
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      // remove the thread status reply
      readInt("thread status", threadStatusMap(), replyData); //$NON-NLS-1$
      int suspendStatus = readInt(
          "suspend status", suspendStatusStrings(), replyData); //$NON-NLS-1$
      boolean result = suspendStatus == SUSPEND_STATUS_SUSPENDED;
View Full Code Here

TOP

Related Classes of org.eclipse.jdi.internal.jdwp.JdwpReplyPacket

Copyright © 2018 www.massapicom. 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.