Package org.eclipse.jdt.internal.debug.core.model

Examples of org.eclipse.jdt.internal.debug.core.model.JDIThread$StepToFrameHandler


    }

    public boolean mayBeOutOfSynch() {
        Iterator threads = getThreadIterator();
        while ( threads.hasNext() ) {
            JDIThread thread = (JDIThread) threads.next();
            if ( thread.mayBeOutOfSynch() ) {
                return true;
            }
        }
        return false;
    }
View Full Code Here


    }

    public JDIThread findThread(ThreadReference tr) {
        Iterator iter = getThreadIterator();
        while ( iter.hasNext() ) {
            JDIThread thread = (JDIThread) iter.next();
            if ( thread.getUnderlyingThread().equals( tr ) ) return thread;
        }
        return null;
    }
View Full Code Here

      JDIDebugElement element,
      int kind,
      int detail)
    throws Exception
  {
    JDIThread thread = (JDIThread) element;
    long threadId = thread.getThreadObject().getUniqueId();

    if (logger.isDebugEnabled()) {
      logger.debug("Handling thread event : " + thread.getName() + " : " +
          threadId +  " " + kind + " " + detail);
    }

    if (kind == DebugEvent.SUSPEND) {
      if ((detail == DebugEvent.STEP_END) ||
          (detail == DebugEvent.BREAKPOINT))
      {
        IJavaStackFrame topStackFrame = (IJavaStackFrame) thread.getTopStackFrame();
        String fileName = getFileNameInFrame(ctx, topStackFrame);
        int lineNum = topStackFrame.getLineNumber();

        if (logger.isDebugEnabled()) {
          if (detail == DebugEvent.BREAKPOINT) {
View Full Code Here

  private void removeCachedThreads(Map<IJavaThread, ICompiledExpression> map, JDIDebugTarget target) {
    Set<IJavaThread> threads = map.keySet();
    List<IJavaThread> threadsToRemove = new ArrayList<IJavaThread>();
    Iterator<IJavaThread> iter = threads.iterator();
    JDIThread thread;
    while (iter.hasNext()) {
      thread = (JDIThread) iter.next();
      if (thread.getDebugTarget() == target) {
        threadsToRemove.add(thread);
      }
    }
    iter = threadsToRemove.iterator();
    while (iter.hasNext()) {
View Full Code Here

      JDIDebugTarget target, boolean suspendVote) {
    try {
      if (isEnabled()
          && event.referenceType().name().equals(getTypeName())) {
        ThreadReference threadRef = event.thread();
        JDIThread thread = target.findThread(threadRef);
        if (thread == null || thread.isIgnoringBreakpoints()) {
          return true;
        }
        return handleBreakpointEvent(event, thread, suspendVote);
      }
    } catch (CoreException e) {
View Full Code Here

    private int determineVote(IEvaluationResult result) {
      if (result.isTerminated()) {
        // indicates the user terminated the evaluation
        return SUSPEND;
      }
      JDIThread thread = (JDIThread) result.getThread();
      if (result.hasErrors()) {
        DebugException exception = result.getException();
        Throwable wrappedException = exception.getStatus()
            .getException();
        if (wrappedException instanceof VMDisconnectedException) {
          // VM terminated/disconnected during evaluation
          return DONT_SUSPEND;
        }
        fireConditionHasRuntimeErrors(fBreakpoint, exception);
        return SUSPEND;
      }
      try {
        IValue value = result.getValue();
        if (fBreakpoint.isConditionSuspendOnTrue()) {
          if (value instanceof IJavaPrimitiveValue) {
            // Suspend when the condition evaluates true
            IJavaPrimitiveValue javaValue = (IJavaPrimitiveValue) value;
            if (javaValue.getJavaType().getName()
                .equals("boolean")) { //$NON-NLS-1$
              if (javaValue.getBooleanValue()) {
                return SUSPEND;
              }
              return DONT_SUSPEND;
            }
          }
          IStatus status = new Status(
              IStatus.ERROR,
              JDIDebugPlugin.getUniqueIdentifier(),
              MessageFormat.format(JDIDebugBreakpointMessages.ConditionalBreakpointHandler_1, value.getReferenceTypeName()));
          // result was not boolean
          fireConditionHasRuntimeErrors(fBreakpoint, new DebugException(status));
          return SUSPEND;
        }
        IDebugTarget debugTarget = thread.getDebugTarget();
        IValue lastValue = fBreakpoint
            .setCurrentConditionValue(debugTarget, value);
        if (!value.equals(lastValue)) {
          return SUSPEND;
        }
View Full Code Here

  /**
   * Returns a list of frames which should be popped in the given threads.
   */
  protected List<JDIStackFrame> getAffectedFrames(IThread[] threads, List<IResource> resourceList,
      List<String> replacedClassNames) throws DebugException {
    JDIThread thread = null;
    JDIStackFrame affectedFrame = null;
    List<JDIStackFrame> popFrames = new ArrayList<JDIStackFrame>();
    int numThreads = threads.length;
    IResource[] resources = new IResource[resourceList.size()];
    resourceList.toArray(resources);
    for (int i = 0; i < numThreads; i++) {
      thread = (JDIThread) threads[i];
      if (thread.isSuspended()) {
        affectedFrame = getAffectedFrame(thread, replacedClassNames);
        if (affectedFrame == null) {
          // No frame to drop to in this thread
          continue;
        }
View Full Code Here

    if (event instanceof ClassPrepareEvent) {
      return handleClassPrepareEvent((ClassPrepareEvent) event, target,
          suspendVote);
    }
    ThreadReference threadRef = ((LocatableEvent) event).thread();
    JDIThread thread = target.findThread(threadRef);
    if (thread == null) {
      // wait for any thread start event sets to complete processing
      // see bug 271700
      try {
        Job.getJobManager().join(ThreadStartEvent.class, null);
      } catch (OperationCanceledException e) {
      } catch (InterruptedException e) {
      }
      thread = target.findThread(threadRef);
    }
    if (thread == null || thread.isIgnoringBreakpoints()) {
      return true;
    }
    return handleBreakpointEvent(event, thread, suspendVote);
  }
View Full Code Here

      threadRef = ((LocatableEvent) event).thread();
    }
    if (threadRef == null) {
      return;
    }
    JDIThread thread = target.findThread(threadRef);
    if (thread == null || thread.isIgnoringBreakpoints()) {
      return;
    }
    if (event instanceof ClassPrepareEvent) {
      classPrepareComplete(event, thread, suspend, eventSet);
    } else {
      thread.completeBreakpointHandling(this, suspend, true, eventSet);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.debug.core.model.JDIThread$StepToFrameHandler

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.