Package org.eclipse.jdi.internal.jdwp

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


   * @see com.sun.jdi.ThreadReference#name()
   */
  public String name() {
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_NAME,
          this);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new ObjectCollectedException();
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      return readString("name", replyData); //$NON-NLS-1$
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
      return null;
    } finally {
View Full Code Here


      throw new UnsupportedOperationException();
    }
    // Note that this information should not be cached.
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.TR_OWNED_MONITORS, 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_5);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();

      int nrOfMonitors = readInt("nr of monitors", replyData); //$NON-NLS-1$
      List<ObjectReference> result = new ArrayList<ObjectReference>(nrOfMonitors);
      for (int i = 0; i < nrOfMonitors; i++) {
        result.add(ObjectReferenceImpl.readObjectRefWithTag(this,
View Full Code Here

   */
  public List<com.sun.jdi.MonitorInfo> ownedMonitorsAndFrames()
      throws IncompatibleThreadStateException {
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.TR_OWNED_MONITOR_STACK_DEPTH, this);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
      case JdwpReplyPacket.INVALID_OBJECT:
        throw new ObjectCollectedException(
            JDIMessages.ThreadReferenceImpl_thread_object_invalid);
      case JdwpReplyPacket.THREAD_NOT_SUSPENDED:
        throw new IncompatibleThreadStateException(
            JDIMessages.ThreadReferenceImpl_Thread_was_not_suspended_5);
      case JdwpReplyPacket.NOT_IMPLEMENTED:
        throw new UnsupportedOperationException(
            JDIMessages.ThreadReferenceImpl_no_force_early_return_on_threads);
      case JdwpReplyPacket.VM_DEAD:
        throw new VMDisconnectedException(JDIMessages.vm_dead);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();

      int owned = readInt("owned monitors", replyData); //$NON-NLS-1$
      List<com.sun.jdi.MonitorInfo> result = new ArrayList<com.sun.jdi.MonitorInfo>(owned);
      ObjectReference monitor = null;
      int depth = -1;
View Full Code Here

   * @see com.sun.jdi.ThreadReference#resume()
   */
  public void resume() {
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.TR_RESUME, this);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new ObjectCollectedException();
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
      resetEventFlags();
    } finally {
      handledJdwpRequest();
    }
  }
View Full Code Here

   */
  public int status() {
    // Note that this information should not be cached.
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.TR_STATUS, this);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.ABSENT_INFORMATION:
        return THREAD_STATUS_UNKNOWN;
      case JdwpReplyPacket.INVALID_THREAD:
        return THREAD_STATUS_NOT_STARTED;
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      int threadStatus = readInt(
          "thread status", threadStatusMap(), replyData); //$NON-NLS-1$
      readInt("suspend status", suspendStatusStrings(), replyData); //$NON-NLS-1$
      switch (threadStatus) {
      case JDWP_THREAD_STATUS_ZOMBIE:
View Full Code Here

      ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
      DataOutputStream outData = new DataOutputStream(outBytes);
      write(this, outData);
      throwableImpl.write(this, outData);

      JdwpReplyPacket replyPacket = requestVM(JdwpCommandPacket.TR_STOP,
          outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new ObjectCollectedException();
      case JdwpReplyPacket.INVALID_CLASS:
        throw new InvalidTypeException(
            JDIMessages.ThreadReferenceImpl_Stop_argument_not_an_instance_of_java_lang_Throwable_in_the_target_VM_7);
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
    } finally {
      handledJdwpRequest();
    }
View Full Code Here

   * @see com.sun.jdi.ThreadReference#suspend()
   */
  public void suspend() {
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.TR_SUSPEND, this);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new ObjectCollectedException();
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
    } finally {
      handledJdwpRequest();
    }
  }
View Full Code Here

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

    if (fThreadGroup != null) {
      return fThreadGroup;
    }
    initJdwpRequest();
    try {
      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.TR_THREAD_GROUP, this);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new ObjectCollectedException();
      }
      defaultReplyErrorHandler(replyPacket.errorCode());
      DataInputStream replyData = replyPacket.dataInStream();
      fThreadGroup = ThreadGroupReferenceImpl.read(this, replyData);
      return fThreadGroup;
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
      return null;
View Full Code Here

      write(this, outData);
      valueImpl.writeWithTag(this, outData);
      writeBoolean(triggerFinallyAndSynchronized,
          "trigger finaly+sync", outData); //$NON-NLS-1$

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.HCR_DO_RETURN, outBytes);
      switch (replyPacket.errorCode()) {
      case JdwpReplyPacket.INVALID_THREAD:
        throw new ObjectCollectedException();
      }
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      boolean result = readBoolean("is enclosed", replyData); //$NON-NLS-1$
      return result;
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
      return false;
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.