Package com.sun.jdi

Examples of com.sun.jdi.IncompatibleThreadStateException


   * @see ThreadReference#popFrames(StackFrame)
   */
  public void popFrames(StackFrame frameToPop)
      throws IncompatibleThreadStateException {
    if (!isSuspended()) {
      throw new IncompatibleThreadStateException();
    }
    if (!virtualMachineImpl().canPopFrames()) {
      throw new UnsupportedOperationException();
    }

    StackFrameImpl frame = (StackFrameImpl) frameToPop;

    initJdwpRequest();
    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:
View Full Code Here


    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();
View Full Code Here

        throw new InvalidTypeException();
      case JdwpReplyPacket.INVALID_CLASS:
        throw new ClassNotLoadedException(
            JDIMessages.ObjectReferenceImpl_One_of_the_arguments_of_ObjectReference_invokeMethod___6);
      case JdwpReplyPacket.INVALID_THREAD:
        throw new IncompatibleThreadStateException();
      case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
        throw new IncompatibleThreadStateException();
      case JdwpReplyPacket.INVALID_TYPESTATE:
        throw new IncompatibleThreadStateException();
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      ValueImpl value = ValueImpl.readWithTag(this, replyData);
      ObjectReferenceImpl exception = ObjectReferenceImpl
View Full Code Here

    }

    /* Throw IncompatibleThreadStateException if not suspended */
    private void assureSuspended() throws IncompatibleThreadStateException {
        if (!thread.isSuspended()) {
            throw new IncompatibleThreadStateException();
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.jdi.IncompatibleThreadStateException

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.