use of com.intellij.xdebugger.XDebugProcess in project buck by facebook.
the class TestExecutionState method attachDebugger.
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);
}
});
}
use of com.intellij.xdebugger.XDebugProcess in project intellij-community by JetBrains.
the class XVariablesView method addEmptyMessage.
protected void addEmptyMessage(XValueContainerNode root) {
XDebugSession session = getSession(getPanel());
if (session != null) {
if (!session.isStopped() && session.isPaused()) {
root.setInfoMessage("Frame is not available", null);
} else {
XDebugProcess debugProcess = session.getDebugProcess();
root.setInfoMessage(debugProcess.getCurrentStateMessage(), debugProcess.getCurrentStateHyperlinkListener());
}
}
}
use of com.intellij.xdebugger.XDebugProcess in project intellij-community by JetBrains.
the class DebuggerAction method refreshViews.
public static void refreshViews(@Nullable XDebugSession session) {
if (session != null) {
XDebugProcess process = session.getDebugProcess();
if (process instanceof JavaDebugProcess) {
((JavaDebugProcess) process).saveNodeHistory();
}
session.rebuildViews();
}
}
use of com.intellij.xdebugger.XDebugProcess in project flutter-intellij by flutter.
the class LaunchState method createDebugSession.
@NotNull
private XDebugSession createDebugSession(@NotNull final ExecutionEnvironment env, @NotNull final FlutterApp app, @NotNull final ExecutionResult executionResult) throws ExecutionException {
final DartUrlResolver resolver = DartUrlResolver.getInstance(env.getProject(), sourceLocation);
final PositionMapper mapper = createPositionMapper(env, app, resolver);
final XDebuggerManager manager = XDebuggerManager.getInstance(env.getProject());
final XDebugSession session = manager.startSession(env, new XDebugProcessStarter() {
@Override
@NotNull
public XDebugProcess start(@NotNull final XDebugSession session) {
return new FlutterDebugProcess(app, env, session, executionResult, resolver, mapper);
}
});
if (app.getMode() != RunMode.DEBUG) {
session.setBreakpointMuted(true);
}
return session;
}
Aggregations