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

Examples of org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$CleanUpJob


      JDIDebugElement element,
      int kind,
      int detail)
    throws Exception
  {
    JDIDebugTarget debugTarget = (JDIDebugTarget) element;

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

    if (kind == DebugEvent.CREATE) {
      ctx.setState(DebuggerState.CONNECTED);
      ctx.refreshDebugStatus();
    } else if (kind == DebugEvent.TERMINATE) {
      ctx.setState(DebuggerState.DISCONNECTED);
      ctx.signalSessionTermination();
    } else if (kind == DebugEvent.SUSPEND) {
      ctx.setState(DebuggerState.SUSPENDED);

      if (detail == DebugEvent.CLIENT_REQUEST) {
        IThread[] threads = debugTarget.getThreads();
        if (threads == null) {
          return;
        }

        for (IThread thread : threads) {
View Full Code Here


    IDebugTarget[] debugTargets = launch.getDebugTargets();
    for (IDebugTarget debugTarget : debugTargets) {
      IJavaDebugTarget jt = (IJavaDebugTarget) debugTarget
          .getAdapter(IJavaDebugTarget.class);
      if (jt != null) {
        JDIDebugTarget target = (JDIDebugTarget) jt;
        if (target.supportsHotCodeReplace()) {
          addHotSwapTarget(target);
        } else if (target.isAvailable()) {
          addNonHotSwapTarget(target);
        }
      }
    }
    synchronized (this) {
View Full Code Here

   */
  @Override
  public void execute() throws CoreException {
    IJavaType type;
    if (fIsPrimitiveType) {
      JDIDebugTarget debugTarget = (JDIDebugTarget) getVM();
      VirtualMachine vm = debugTarget.getVM();
      if (vm == null) {
        debugTarget
            .requestFailed(
                InstructionsEvaluationMessages.LocalVariableCreation_Execution_failed___VM_disconnected__1,
                null);
      }
      type = JDIType.createType(debugTarget, PrimitiveTypeImpl.create(
View Full Code Here

  public void setThreadFilter(IJavaThread thread) throws CoreException {
    if (!(thread.getDebugTarget() instanceof JDIDebugTarget)
        || !(thread instanceof JDIThread)) {
      return;
    }
    JDIDebugTarget target = (JDIDebugTarget) thread.getDebugTarget();
    if (thread != fFilteredThreadsByTarget.put(target, thread)) {
      // recreate the breakpoint only if it is not the same thread

      // Other breakpoints set attributes on the underlying
      // marker and the marker changes are eventually
View Full Code Here

   * Remove thread filters for terminated threads
   *
   * Subclasses may override but need to call super.
   */
  protected void cleanupForThreadTermination(JDIThread thread) {
    JDIDebugTarget target = (JDIDebugTarget) thread.getDebugTarget();
    try {
      if (thread == getThreadFilter(target)) {
        removeThreadFilter(target);
      }
    } catch (CoreException exception) {
View Full Code Here

  public void removeThreadFilter(IJavaDebugTarget javaTarget)
      throws CoreException {
    if (!(javaTarget instanceof JDIDebugTarget)) {
      return;
    }
    JDIDebugTarget target = (JDIDebugTarget) javaTarget;
    if (fFilteredThreadsByTarget.remove(target) != null) {
      recreate(target);
      fireChanged();
    }
  }
View Full Code Here

   * qualified names.
   */
  protected void notifyUnsupportedHCR(List<JDIDebugTarget> targets, List<IResource> resources,
      List<String> qualifiedNames) {
    Iterator<JDIDebugTarget> iter = targets.iterator();
    JDIDebugTarget target = null;
    while (iter.hasNext()) {
      target = iter.next();
      if (target.isAvailable()) {
        // Make a local copy of the resources/names to swap so we can
        // filter
        // unloaded types on a per-target basis.
        List<IResource> resourcesToReplace = new ArrayList<IResource>(resources);
        List<String> qualifiedNamesToReplace = new ArrayList<String>(qualifiedNames);
View Full Code Here

        JDIDebugPlugin.getUniqueIdentifier(),
        DebugException.TARGET_REQUEST_FAILED,
        "At least one target failed to drop to frame after successful hot code replace.", null); //$NON-NLS-1$
    Iterator<JDIDebugTarget> iter = targets.iterator();
    while (iter.hasNext()) {
      JDIDebugTarget target = iter.next();
      if (!target.isAvailable()) {
        deregisterTarget(target);
        continue;
      }
      // Make a local copy of the resources/names to swap so we can filter
      // unloaded types on a per-target basis.
      List<IResource> resourcesToReplace = new ArrayList<IResource>(resources);
      List<String> qualifiedNamesToReplace = new ArrayList<String>(qualifiedNames);
      filterUnloadedTypes(target, resourcesToReplace,
          qualifiedNamesToReplace);
      if (qualifiedNamesToReplace.isEmpty()) {
        // If none of the changed types are loaded, do nothing.
        continue;
      }

      List<IThread> poppedThreads = new ArrayList<IThread>();
      target.setIsPerformingHotCodeReplace(true);
      try {
        boolean framesPopped = false;
        if (target.canPopFrames()) {
          // JDK 1.4 drop to frame support:
          // JDK 1.4 spec is faulty around methods that have
          // been rendered obsolete after class redefinition.
          // Thus, pop the frames that contain affected methods
          // *before* the class redefinition to avoid problems.
          try {
            attemptPopFrames(target, resourcesToReplace,
                qualifiedNamesToReplace, poppedThreads);
            framesPopped = true; // No exception occurred
          } catch (DebugException de) {
            if (shouldLogHCRException(de)) {
              ms.merge(de.getStatus());
            }
          }
        }
        target.removeOutOfSynchTypes(qualifiedNamesToReplace);
        if (target.supportsJDKHotCodeReplace()) {
          redefineTypesJDK(target, resourcesToReplace,
              qualifiedNamesToReplace);
        } else if (target.supportsJ9HotCodeReplace()) {
          redefineTypesJ9(target, qualifiedNamesToReplace);
        }
        if (containsObsoleteMethods(target)) {
          fireObsoleteMethods(target);
        }
        try {
          if (target.canPopFrames() && framesPopped) {
            // Second half of JDK 1.4 drop to frame support:
            // All affected frames have been popped and the classes
            // have been reloaded. Step into the first changed
            // frame of each affected thread.
            // must re-set 'is doing HCR' to be able to step
            target.setIsPerformingHotCodeReplace(false);
            attemptStepIn(poppedThreads);
          } else {
            // J9 drop to frame support:
            // After redefining classes, drop to frame
            attemptDropToFrame(target, resourcesToReplace,
                qualifiedNamesToReplace);
          }
        } catch (DebugException de) {
          if (shouldLogHCRException(de)) {
            ms.merge(de.getStatus());
          }
        }
        fireHCRSucceeded(target);
      } catch (DebugException de) {
        // target update failed
        fireHCRFailed(target, de);
      }
      // also re-set 'is doing HCR' here in case HCR failed
      target.setIsPerformingHotCodeReplace(false);
      target.fireChangeEvent(DebugEvent.CONTENT);
    }
    if (!ms.isOK()) {
      JDIDebugPlugin.log(ms);
    }
    fDeltaCache.clear();
View Full Code Here

      final boolean allowTerminate, final boolean allowDisconnect,
      final boolean resume) {
    final IJavaDebugTarget[] target = new IJavaDebugTarget[1];
    IWorkspaceRunnable r = new IWorkspaceRunnable() {
      public void run(IProgressMonitor m) {
        target[0] = new JDIDebugTarget(launch, vm, name,
            allowTerminate, allowDisconnect, process, resume);
      }
    };
    try {
      ResourcesPlugin.getWorkspace().run(r, null, 0, null);
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget$CleanUpJob

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.