Beispiel #1
0
  public ILaunchConfiguration asLaunchConfiguration() {
    final ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
    final ILaunchConfigurationType type =
        manager.getLaunchConfigurationType(ErlangLaunchDelegate.CONFIGURATION_TYPE_INTERNAL);
    ILaunchConfigurationWorkingCopy workingCopy;
    try {
      final RuntimeInfo info = getRuntimeInfo();
      final String name = getNodeName();
      workingCopy = type.newInstance(null, name);
      workingCopy.setAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, Charsets.ISO_8859_1.name());
      workingCopy.setAttribute(
          DebugPlugin.ATTR_PROCESS_FACTORY_ID, "org.erlide.core.ertsProcessFactory");

      workingCopy.setAttribute(ErlLaunchAttributes.NODE_NAME, getNodeName());
      workingCopy.setAttribute(ErlLaunchAttributes.RUNTIME_NAME, info.getName());
      workingCopy.setAttribute(ErlLaunchAttributes.COOKIE, getCookie());
      // workingCopy.setAttribute(ErlLaunchAttributes.CONSOLE,
      // !options.contains(BackendOptions.NO_CONSOLE));
      workingCopy.setAttribute(ErlLaunchAttributes.USE_LONG_NAME, hasLongName());
      workingCopy.setAttribute(ErlLaunchAttributes.INTERNAL, isInternal());

      return workingCopy;
    } catch (final CoreException e) {
      e.printStackTrace();
      return null;
    }
  }
Beispiel #2
0
  @SuppressWarnings("unchecked")
  public BackendData(
      final RuntimeInfo runtime, final ILaunchConfiguration config, final String mode) {
    super(runtime, mode);

    projects = Lists.newArrayList();

    Asserts.isNotNull(config);
    try {
      cookie = config.getAttribute(ErlLaunchAttributes.COOKIE, cookie);
      managed = config.getAttribute(ErlLaunchAttributes.MANAGED, managed);
      restartable = config.getAttribute(ErlLaunchAttributes.RESTARTABLE, restartable);
      startShell = config.getAttribute(ErlLaunchAttributes.SHELL, startShell);
      console = config.getAttribute(ErlLaunchAttributes.CONSOLE, console);

      runtimeName = config.getAttribute(ErlLaunchAttributes.RUNTIME_NAME, runtimeName);
      nodeName = config.getAttribute(ErlLaunchAttributes.NODE_NAME, nodeName);
      longName = config.getAttribute(ErlLaunchAttributes.USE_LONG_NAME, longName);
      extraArgs = config.getAttribute(ErlLaunchAttributes.EXTRA_ARGS, extraArgs);
      workingDir = config.getAttribute(ErlLaunchAttributes.WORKING_DIR, workingDir);
      env = config.getAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, env);
      initialCall = createInitialCall(config);
      debugFlags =
          ErlDebugFlags.makeSet(
              config.getAttribute(
                  ErlLaunchAttributes.DEBUG_FLAGS, ErlDebugFlags.getFlag(debugFlags)));
      loadOnAllNodes = config.getAttribute(ErlLaunchAttributes.LOAD_ALL_NODES, loadOnAllNodes);
      internal = config.getAttribute(ErlLaunchAttributes.INTERNAL, internal);

      projects = getProjects(config);
      final List<String> intMods =
          config.getAttribute(ErlLaunchAttributes.DEBUG_INTERPRET_MODULES, interpretedModules);
      interpretedModules = addBreakpointProjectsAndModules(getProjects(), intMods);
    } catch (final CoreException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }

    if (runtime != null) {
      runtimeInfo = runtime.setArgs(getExtraArgs());
      runtimeName = runtime.getName();
      try {
        if (config.getAttribute(ErlLaunchAttributes.EXTRA_ARGS, "").equals("")) {
          setExtraArgs(runtime.getArgs());
        }
      } catch (final CoreException e) {
      }
    }
    setManaged(shouldManageNode(getNodeName(), BackendCore.getEpmdWatcher()));
  }