Package org.eclipse.debug.core.model

Examples of org.eclipse.debug.core.model.IProcess


    public void init(IPageBookViewPage page, IConsole console) {
        if (!(console instanceof ProcessConsole)) {
            return;
        }
        ProcessConsole processConsole = (ProcessConsole) console;
        IProcess process = processConsole.getProcess();
        if (process == null) {
            return;
        }
        String attribute = process.getAttribute(Constants.PYDEV_ADD_RELAUNCH_IPROCESS_ATTR);
        if (!Constants.PYDEV_ADD_RELAUNCH_IPROCESS_ATTR_TRUE.equals(attribute)) {
            //Only provide relaunch if specified
            return;
        }
        this.fConsole = processConsole;
View Full Code Here


        return false;
    }

    @Override
    public String getName() throws DebugException {
        IProcess process = getDebugTarget().getProcess();
        return process.getLabel();
    }
View Full Code Here

        processAttributes.put(IProcess.ATTR_CMDLINE, config.getCommandLineAsString());
        processAttributes.put(Constants.PYDEV_DEBUG_IPROCESS_ATTR, Constants.PYDEV_DEBUG_IPROCESS_ATTR_TRUE);

        //Set the debug target before registering with the debug plugin (we want it before creating the console).
        PyDebugTarget t = new PyDebugTarget(launch, null, config.resource, debugger, config.project);
        IProcess process;
        try {
            process = registerWithDebugPluginForProcessType(config.getRunningName(), launch, p, processAttributes,
                    config);
            t.process = process;
        } finally {
            t.finishedInit = true;
        }

        subMonitor.subTask("Waiting for connection...");
        Socket socket = null;
        try {
            socket = debugger.waitForConnect(subMonitor, p, process);
            if (socket == null) {
                debugger.dispose();
                return;
            }
        } catch (Exception ex) {
            process.terminate();
            p.destroy();
            String message = "Unexpected error setting up the debugger";
            if (ex instanceof SocketTimeoutException)
                message = "Timed out after " + Float.toString(config.acceptTimeout / 1000)
                        + " seconds while waiting for python script to connect.";
View Full Code Here

        subMonitor.subTask("Exec...");

        //it was dying before register, so, I made this faster to see if this fixes it
        Process p = createProcess(launch, envp, cmdLine, workingDirectory);

        IProcess process;
        String label = cmdLine[cmdLine.length - 1];

        //in the interactive session, we'll just create the process, it won't actually be registered
        //in the debug plugin (the communication is all done through xml-rpc).
        if (config.isInteractive) {
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.ui.texteditor.IUpdate#update()
     */
    public void update() {
        IProcess process = console.getProcess();
        setEnabled(true);
        KeySequence binding = KeyBindingHelper
                .getCommandKeyBinding("org.python.pydev.debug.ui.actions.relaunchLastAction");
        String str = binding != null ? "(" + binding.format() + " when on Pydev editor)" : "(unbinded)";
        if (process.canTerminate()) {
            this.setImageDescriptor(PydevPlugin.getImageCache().getDescriptor(UIConstants.RELAUNCH));
            this.setToolTipText("Restart the current launch. " + str);

        } else {
            this.setImageDescriptor(PydevPlugin.getImageCache().getDescriptor(UIConstants.RELAUNCH1));
View Full Code Here

      if (element != null) {
        debugTarget = element.getDebugTarget();
      }
    }
    if (debugTarget == null) {
      IProcess process = DebugUITools.getCurrentProcess();
      if (process instanceof PHPProcess) {
        debugTarget = ((PHPProcess) process).getDebugTarget();
      }
    }
    return debugTarget;
View Full Code Here

    final Process phpExeProcess = DebugPlugin.exec(cmdLine, workingDir,
        envVarString);
    // Attach a crash detector
    new Thread(new ProcessCrashDetector(launch, phpExeProcess)).start();

    IProcess eclipseProcessWrapper = null;
    if (phpExeProcess != null) {
      subMonitor.worked(10);
      eclipseProcessWrapper = DebugPlugin.newProcess(launch,
          phpExeProcess, phpExe.toOSString(), processAttributes);
      if (eclipseProcessWrapper == null) {
View Full Code Here

        inputGobbler.start();
      }
      int exitValue = process.waitFor();
      IDebugTarget debugTarget = launch.getDebugTarget();
      if (debugTarget != null) {
        IProcess p = debugTarget.getProcess();
        if (p instanceof PHPProcess) {
          ((PHPProcess) p).setExitValue(exitValue);
        }
      }
View Full Code Here

      return true;
    }

    Iterator processes = getProcesses0().iterator();
    while (processes.hasNext()) {
      IProcess process = (IProcess) processes.next();
      if (!process.isTerminated()) {
        return false;
      }
    }

    Iterator targets = getDebugTargets0().iterator();
View Full Code Here

          workingDir, envp) : DebugPlugin.exec(cmdLine, null, envp);

      // Attach a crash detector
      new Thread(new ProcessCrashDetector(launch, p)).start();

      IProcess process = null;

      // add process type to process attributes
      Map<String, String> processAttributes = new HashMap<String, String>();
      String programName = phpExe.lastSegment();
      String extension = phpExe.getFileExtension();

      if (extension != null) {
        programName = programName.substring(0, programName.length()
            - (extension.length() + 1));
      }

      programName = programName.toLowerCase();
      processAttributes.put(IProcess.ATTR_PROCESS_TYPE, programName);

      if (p != null) {
        subMonitor = new SubProgressMonitor(monitor, 80); // 10+80 of
                                  // 100;
        subMonitor
            .beginTask(
                MessageFormat
                    .format("start launch", new Object[] { configuration.getName() }), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
        process = DebugPlugin.newProcess(launch, p,
            phpExe.toOSString(), processAttributes);
        if (process == null) {
          p.destroy();
          throw new CoreException(new Status(IStatus.ERROR,
              PHPDebugPlugin.getID(), 0, null, null));
        }
        subMonitor.done();
      }
      process.setAttribute(IProcess.ATTR_CMDLINE, fileName);

      if (CommonTab.isLaunchInBackground(configuration)) {
        // refresh resources after process finishes
        /*
         * if (RefreshTab.getRefreshScope(configuration) != null) {
         * BackgroundResourceRefresher refresher = new
         * BackgroundResourceRefresher(configuration, process);
         * refresher.startBackgroundRefresh(); }
         */
      } else {
        // wait for process to exit
        while (!process.isTerminated()) {
          try {
            if (monitor.isCanceled()) {
              process.terminate();
              break;
            }
            Thread.sleep(50);
          } catch (InterruptedException e) {
          }
View Full Code Here

TOP

Related Classes of org.eclipse.debug.core.model.IProcess

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.