• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java RemoteStateState类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.intellij.debugger.engine.RemoteStateState的典型用法代码示例。如果您正苦于以下问题:Java RemoteStateState类的具体用法?Java RemoteStateState怎么用?Java RemoteStateState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

RemoteStateState类属于com.intellij.debugger.engine包,在下文中一共展示了RemoteStateState类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: attachVM

点赞 3

import com.intellij.debugger.engine.RemoteStateState; //导入依赖的package包/类
protected DebuggerSession attachVM(final RemoteConnection remoteConnection, final boolean pollConnection)
        throws InvocationTargetException, InterruptedException {
  final RemoteState remoteState = new RemoteStateState(myProject, remoteConnection);

  final DebuggerSession[] debuggerSession = new DebuggerSession[1];
  UIUtil.invokeAndWaitIfNeeded(new Runnable() {
    @Override
    public void run() {
      try {
        debuggerSession[0] = attachVirtualMachine(remoteState, new ExecutionEnvironmentBuilder(myProject, DefaultDebugExecutor.getDebugExecutorInstance())
          .runProfile(new MockConfiguration())
          .build(), remoteConnection, pollConnection);
      }
      catch (ExecutionException e) {
        fail(e.getMessage());
      }
    }
  });
  debuggerSession[0].getProcess().getProcessHandler().addProcessListener(new ProcessAdapter() {
    @Override
    public void onTextAvailable(ProcessEvent event, Key outputType) {
      print(event.getText(), outputType);
    }
  });
  return debuggerSession[0];
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:27,
代码来源:DebuggerTestCase.java

示例2: attachVM

点赞 3

import com.intellij.debugger.engine.RemoteStateState; //导入依赖的package包/类
protected DebuggerSession attachVM(final RemoteConnection remoteConnection, final boolean pollConnection)
        throws InvocationTargetException, InterruptedException {
  final RemoteState remoteState = new RemoteStateState(myProject, remoteConnection);

  final DebuggerSession[] debuggerSession = new DebuggerSession[1];
  UIUtil.invokeAndWaitIfNeeded(new Runnable() {
    @Override
    public void run() {
      try {
        debuggerSession[0] = attachVirtualMachine(remoteState, remoteConnection, pollConnection);
      }
      catch (ExecutionException e) {
        fail(e.getMessage());
      }
    }
  });
  debuggerSession[0].getProcess().getExecutionResult().getProcessHandler().addProcessListener(new ProcessAdapter() {
    @Override
    public void onTextAvailable(ProcessEvent event, Key outputType) {
      print(event.getText(), outputType);
    }
  });
  return debuggerSession[0];
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:25,
代码来源:DebuggerTestCase.java

示例3: getState

点赞 2

import com.intellij.debugger.engine.RemoteStateState; //导入依赖的package包/类
@Override
public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException {
  final GenericDebuggerRunnerSettings debuggerSettings = (GenericDebuggerRunnerSettings)env.getRunnerSettings();
  if (debuggerSettings != null) {
    // sync self state with execution environment's state if available
    debuggerSettings.LOCAL = false;
    debuggerSettings.setDebugPort(USE_SOCKET_TRANSPORT ? PORT : SHMEM_ADDRESS);
    debuggerSettings.setTransport(USE_SOCKET_TRANSPORT ? DebuggerSettings.SOCKET_TRANSPORT : DebuggerSettings.SHMEM_TRANSPORT);
  }
  return new RemoteStateState(getProject(), createRemoteConnection());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:12,
代码来源:RemoteConfiguration.java

示例4: getState

点赞 2

import com.intellij.debugger.engine.RemoteStateState; //导入依赖的package包/类
public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException {
  GenericDebuggerRunnerSettings debuggerSettings = (GenericDebuggerRunnerSettings)env.getRunnerSettings();
  debuggerSettings.LOCAL = false;
  debuggerSettings.setDebugPort(USE_SOCKET_TRANSPORT ? PORT : SHMEM_ADDRESS);
  debuggerSettings.setTransport(USE_SOCKET_TRANSPORT ? DebuggerSettings.SOCKET_TRANSPORT : DebuggerSettings.SHMEM_TRANSPORT);
  return new RemoteStateState(getProject(), createRemoteConnection());
}
 

开发者ID:lshain-android-source,
项目名称:tools-idea,
代码行数:8,
代码来源:RemoteConfiguration.java

示例5: getState

点赞 2

import com.intellij.debugger.engine.RemoteStateState; //导入依赖的package包/类
@Override
public RunProfileState getState(@NotNull final Executor executor, @NotNull final ExecutionEnvironment env) throws ExecutionException
{
	GenericDebuggerRunnerSettings debuggerSettings = (GenericDebuggerRunnerSettings) env.getRunnerSettings();
	debuggerSettings.LOCAL = false;
	debuggerSettings.setDebugPort(USE_SOCKET_TRANSPORT ? PORT : SHMEM_ADDRESS);
	debuggerSettings.setTransport(USE_SOCKET_TRANSPORT ? DebuggerSettings.SOCKET_TRANSPORT : DebuggerSettings.SHMEM_TRANSPORT);
	return new RemoteStateState(getProject(), createRemoteConnection());
}
 

开发者ID:consulo,
项目名称:consulo-java
代码行数:10,
代码来源:RemoteConfiguration.java

示例6: attachDebugger

点赞 2

import com.intellij.debugger.engine.RemoteStateState; //导入依赖的package包/类
private void attachDebugger(String title, String port) {
  final RemoteConnection remoteConnection =
      new RemoteConnection(/* useSockets */ true, "localhost", port, /* serverMode */ false);
  final RemoteStateState state = new RemoteStateState(mProject, remoteConnection);
  final String name = title + " debugger (" + port + ")";
  final ConfigurationFactory cfgFactory =
      ConfigurationTypeUtil.findConfigurationType("Remote").getConfigurationFactories()[0];
  RunnerAndConfigurationSettings runSettings =
      RunManager.getInstance(mProject).createRunConfiguration(name, cfgFactory);
  final Executor debugExecutor = DefaultDebugExecutor.getDebugExecutorInstance();
  final ExecutionEnvironment env =
      new ExecutionEnvironmentBuilder(mProject, debugExecutor)
          .runProfile(runSettings.getConfiguration())
          .build();
  final int pollTimeout = 3000;
  final DebugEnvironment environment =
      new DefaultDebugEnvironment(env, state, remoteConnection, pollTimeout);

  ApplicationManager.getApplication()
      .invokeLater(
          () -> {
            try {
              final DebuggerSession debuggerSession =
                  DebuggerManagerEx.getInstanceEx(mProject).attachVirtualMachine(environment);
              if (debuggerSession == null) {
                return;
              }
              XDebuggerManager.getInstance(mProject)
                  .startSessionAndShowTab(
                      name,
                      null,
                      new XDebugProcessStarter() {
                        @Override
                        @NotNull
                        public XDebugProcess start(@NotNull XDebugSession session) {
                          return JavaDebugProcess.create(session, debuggerSession);
                        }
                      });
            } catch (ExecutionException e) {
              LOG.error(
                  "failed to attach to debugger on port "
                      + port
                      + " with polling timeout "
                      + pollTimeout);
            }
          });
}
 

开发者ID:facebook,
项目名称:buck,
代码行数:48,
代码来源:TestExecutionState.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)