com.intellij.debugger.engine.DebugProcessImpl Java Examples

The following examples show how to use com.intellij.debugger.engine.DebugProcessImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExternalFilePositionManager.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public PositionManager createPositionManager(DebugProcess process) {
  return process instanceof DebugProcessImpl && Blaze.isBlazeProject(process.getProject())
      ? new ExternalFilePositionManager((DebugProcessImpl) process)
      : null;
}
 
Example #2
Source File: MultiRunDebuggerSessionListener.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public void processDetached(DebugProcess process, boolean closedByUser) {
  if (closedByUser) {
    return;
  }
  try {
    reattach((DebugProcessImpl) process, debugEnvironment);
  } catch (ExecutionException e) {
    ExecutionUtil.handleExecutionError(
        executionEnvironment.getProject(),
        executionEnvironment.getExecutor().getToolWindowId(),
        executionEnvironment.getRunProfile(),
        e);
  }
}
 
Example #3
Source File: MultiRunDebuggerSessionListener.java    From intellij with Apache License 2.0 5 votes vote down vote up
private static void reattach(DebugProcessImpl process, DebugEnvironment debugEnvironment)
    throws ExecutionException {
  // Reattaching the debug process happens in a new worker thread request.
  // Stop the existing request first to avoid an IllegalStateException in
  // InvokeThread#run.
  process.getManagerThread().getCurrentRequest().requestStop();
  process.reattach(debugEnvironment);
}
 
Example #4
Source File: RoboVmRunner.java    From robovm-idea with GNU General Public License v2.0 5 votes vote down vote up
@Nullable
protected RunContentDescriptor attachVirtualMachine(RunProfileState state,
                                                    @NotNull ExecutionEnvironment env,
                                                    RemoteConnection connection,
                                                    boolean pollConnection) throws ExecutionException {
    DebugEnvironment environment = new DefaultDebugUIEnvironment(env, state, connection, pollConnection).getEnvironment();
    final DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(env.getProject()).attachVirtualMachine(environment);
    if (debuggerSession == null) {
        return null;
    }

    final DebugProcessImpl debugProcess = debuggerSession.getProcess();
    if (debugProcess.isDetached() || debugProcess.isDetaching()) {
        debuggerSession.dispose();
        return null;
    }
    // optimization: that way BatchEvaluator will not try to lookup the class file in remote VM
    // which is an expensive operation when executed first time
    debugProcess.putUserData(BatchEvaluator.REMOTE_SESSION_KEY, Boolean.TRUE);

    return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() {
        @Override
        @NotNull
        public XDebugProcess start(@NotNull XDebugSession session) {
            XDebugSessionImpl sessionImpl = (XDebugSessionImpl)session;
            ExecutionResult executionResult = debugProcess.getExecutionResult();
            sessionImpl.addExtraActions(executionResult.getActions());
            if (executionResult instanceof DefaultExecutionResult) {
                sessionImpl.addRestartActions(((DefaultExecutionResult)executionResult).getRestartActions());
                sessionImpl.addExtraStopActions(((DefaultExecutionResult)executionResult).getAdditionalStopActions());
            }
            return JavaDebugProcess.create(session, debuggerSession);
        }
    }).getRunContentDescriptor();
}
 
Example #5
Source File: ExternalFilePositionManager.java    From intellij with Apache License 2.0 4 votes vote down vote up
ExternalFilePositionManager(DebugProcessImpl debugProcess) {
  super(debugProcess);
}