Package org.eclipse.jdi.internal.jdwp

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


    try {
      ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
      DataOutputStream outData = new DataOutputStream(outBytes);
      frame.writeWithThread(frame, outData);

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.SF_POP_FRAME, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new InvalidStackFrameException();
      case JdwpReplyPacket.INVALID_FRAMEID:
        throw new InvalidStackFrameException(
            JDIMessages.ThreadReferenceImpl_Unable_to_pop_the_requested_stack_frame_from_the_call_stack__Reasons_include__The_frame_id_was_invalid__The_thread_was_resumed__10);
      case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
        throw new IncompatibleThreadStateException(
            JDIMessages.ThreadReferenceImpl_Unable_to_pop_the_requested_stack_frame__The_requested_stack_frame_is_not_suspended_11);
      case JdwpReplyPacket.NO_MORE_FRAMES:
        throw new InvalidStackFrameException(
            JDIMessages.ThreadReferenceImpl_Unable_to_pop_the_requested_stack_frame_from_the_call_stack__Reasons_include__The_requested_frame_was_the_last_frame_on_the_call_stack__The_requested_frame_was_the_last_frame_above_a_native_frame__12);
      default:
        defaultReplyErrorHandler(replyPacket.errorCode());
      }
    } catch (IOException ioe) {
      defaultIOExceptionHandler(ioe);
    } finally {
      handledJdwpRequest();
View Full Code Here


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

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.AR_GET_VALUES, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_INDEX:
        throw new IndexOutOfBoundsException(
            JDIMessages.ArrayReferenceImpl_Invalid_index_of_array_reference_given_1);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();

      /*
       * NOTE: The JDWP documentation is not clear on this: it turns out
       * that the following is received from the VM: - type tag; - length
       * of array; - values of elements.
View Full Code Here

    if (fModifierBits != -1)
      return fModifierBits;

    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.RT_MODIFIERS, this);
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      fModifierBits = readInt(
          "modifiers", AccessibleImpl.getModifierStrings(), replyData); //$NON-NLS-1$
      return fModifierBits;
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
View Full Code Here

      return fInterfaces;
    }

    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.RT_INTERFACES, this);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.NOT_FOUND:
        // Workaround for problem in J2ME WTK (wireless toolkit)
        // @see Bug 12966
        return Collections.EMPTY_LIST;
      default:
        defaultReplyErrorHandler(replyPacket.errorCode());
      }
      DataInputStream replyData = replyPacket.dataInStream();
      List<InterfaceType> elements = new ArrayList<InterfaceType>();
      int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
      for (int i = 0; i < nrOfElements; i++) {
        InterfaceTypeImpl ref = InterfaceTypeImpl.read(this, replyData);
        if (ref == null) {
View Full Code Here

    if (fClassLoader != null)
      return fClassLoader;

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

    if (fClassObject != null)
      return fClassObject;

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

   */
  protected int status() {
    // Note that this information should not be cached.
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.RT_STATUS, this);
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      int status = readInt("status", classStatusStrings(), replyData); //$NON-NLS-1$
      return status;
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
      return 0;
View Full Code Here

    try {
      boolean withGenericSignature = virtualMachineImpl()
          .isJdwpVersionGreaterOrEqual(1, 5);
      int jdwpCommand = withGenericSignature ? JdwpCommandPacket.RT_FIELDS_WITH_GENERIC
          : JdwpCommandPacket.RT_FIELDS;
      JdwpReplyPacket replyPacket = requestVM(jdwpCommand, this);
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      List<Field> elements = new ArrayList<Field>();
      int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
      for (int i = 0; i < nrOfElements; i++) {
        FieldImpl elt = FieldImpl.readWithNameSignatureModifiers(this,
            this, withGenericSignature, replyData);
View Full Code Here

        FieldImpl field = (FieldImpl) fields.get(i);
        checkVM(field);
        field.getFieldID().write(outData);
      }

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

      DataInputStream replyData = replyPacket.dataInStream();
      HashMap<Field, Value> map = new HashMap<Field, Value>();
      int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
      if (nrOfElements != fieldsSize)
        throw new InternalError(
            JDIMessages.ReferenceTypeImpl_Retrieved_a_different_number_of_values_from_the_VM_than_requested_3);
View Full Code Here

    try {
      boolean withGenericSignature = virtualMachineImpl()
          .isJdwpVersionGreaterOrEqual(1, 5);
      int jdwpCommand = withGenericSignature ? JdwpCommandPacket.RT_METHODS_WITH_GENERIC
          : JdwpCommandPacket.RT_METHODS;
      JdwpReplyPacket replyPacket = requestVM(jdwpCommand, this);
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      List<Method> elements = new ArrayList<Method>();
      int nrOfElements = readInt("elements", replyData); //$NON-NLS-1$
      for (int i = 0; i < nrOfElements; i++) {
        MethodImpl elt = MethodImpl.readWithNameSignatureModifiers(
            this, this, withGenericSignature, replyData);
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.