Examples of JdwpReplyPacket


Examples of gnu.classpath.jdwp.transport.JdwpReplyPacket

      }
   
    if (pkt != null)
      {
        JdwpCommandPacket commandPkt = (JdwpCommandPacket) pkt;
        JdwpReplyPacket reply = new JdwpReplyPacket(commandPkt);
       
        // Reset our output stream
        _outputBytes.reset();
       
        // Create a ByteBuffer around the command packet
        ByteBuffer bb = ByteBuffer.wrap(commandPkt.getData());
        byte command = commandPkt.getCommand();
        byte commandSet = commandPkt.getCommandSet();
       
        CommandSet set = null;
        try
          {
            // There is no command set with value 0
            if (commandSet > 0 && commandSet < _sets.length)
              {
                set = _sets[commandPkt.getCommandSet()];
              }
            if (set != null)
              {
                _shutdown = set.runCommand(bb, _os, command);
                reply.setData(_outputBytes.toByteArray());
              }
            else
              {
                // This command set wasn't in our tree
                reply.setErrorCode(JdwpConstants.Error.NOT_IMPLEMENTED);
              }
          }
          catch (JdwpException ex)
            {
            reply.setErrorCode(ex.getErrorCode ());
            }
          _connection.sendPacket (reply);
      }
  }
View Full Code Here

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

      }

      writeInt(optionsToJdwpOptions(options),
          "options", MethodImpl.getInvokeOptions(), outData); //$NON-NLS-1$

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.CT_INVOKE_METHOD, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_METHODID:
        throw new IllegalArgumentException();
      case JdwpReplyPacket.TYPE_MISMATCH:
        throw new InvalidTypeException();
      case JdwpReplyPacket.INVALID_CLASS:
        throw new ClassNotLoadedException(name());
      case JdwpReplyPacket.INVALID_THREAD:
        throw new IncompatibleThreadStateException();
      case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
        throw new IncompatibleThreadStateException();
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      ValueImpl value = ValueImpl.readWithTag(this, replyData);
      ObjectReferenceImpl exception = ObjectReferenceImpl
          .readObjectRefWithTag(this, replyData);
      if (exception != null)
        throw new InvocationException(exception);
View Full Code Here

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

      }

      writeInt(optionsToJdwpOptions(options),
          "options", MethodImpl.getInvokeOptions(), outData); //$NON-NLS-1$

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.CT_NEW_INSTANCE, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_METHODID:
        throw new IllegalArgumentException();
      case JdwpReplyPacket.TYPE_MISMATCH:
        throw new InvalidTypeException();
      case JdwpReplyPacket.INVALID_CLASS:
        throw new ClassNotLoadedException(name());
      case JdwpReplyPacket.INVALID_THREAD:
        throw new IncompatibleThreadStateException();
      case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
        throw new IncompatibleThreadStateException();
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      ObjectReferenceImpl object = ObjectReferenceImpl
          .readObjectRefWithTag(this, replyData);
      ObjectReferenceImpl exception = ObjectReferenceImpl
          .readObjectRefWithTag(this, replyData);
      if (exception != null)
View Full Code Here

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

        checkedValue.write(this, outData);
      } else {
        ValueImpl.writeNull(this, outData);
      }

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.CT_SET_VALUES, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.TYPE_MISMATCH:
        throw new InvalidTypeException();
      case JdwpReplyPacket.INVALID_CLASS:
        throw new ClassNotLoadedException(name());
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
    } finally {
      handledJdwpRequest();
    }
View Full Code Here

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

    if (fSuperclass != null)
      return fSuperclass;

    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.CT_SUPERCLASS, this);
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      fSuperclass = ClassTypeImpl.read(this, replyData);
      return fSuperclass;
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
      return null;
View Full Code Here

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

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

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

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

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

    try {
      boolean withGenericSignature = virtualMachineImpl()
          .isJdwpVersionGreaterOrEqual(1, 5);
      int jdwpCommand = withGenericSignature ? JdwpCommandPacket.VM_ALL_CLASSES_WITH_GENERIC
          : JdwpCommandPacket.VM_ALL_CLASSES;
      JdwpReplyPacket replyPacket = requestVM(jdwpCommand);
      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
            .readWithTypeTagAndSignature(this,
View Full Code Here

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

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

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

      command = JdwpCommandPacket.VM_CAPABILITIES_NEW;
    }

    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(command);
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();

      fCanWatchFieldModification = readBoolean(
          "watch field modification", replyData); //$NON-NLS-1$
      fCanWatchFieldAccess = readBoolean("watch field access", replyData); //$NON-NLS-1$
      fCanGetBytecodes = readBoolean("get bytecodes", replyData); //$NON-NLS-1$
View Full Code Here

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

    try {
      ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
      DataOutputStream outData = new DataOutputStream(outBytes);
      writeString(signature, "signature", outData); //$NON-NLS-1$

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.VM_CLASSES_BY_SIGNATURE, outBytes);
      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);
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.