use of com.intellij.debugger.engine.DebugProcess in project android by JetBrains.
the class AndroidRemoteDebugProcessHandler method destroyProcessImpl.
@Override
protected void destroyProcessImpl() {
DebugProcess debugProcess = DebuggerManager.getInstance(myProject).getDebugProcess(this);
if (debugProcess != null) {
debugProcess.stop(true);
}
notifyProcessTerminated(0);
}
use of com.intellij.debugger.engine.DebugProcess in project android by JetBrains.
the class AndroidRemoteDebugProcessHandler method startNotify.
// This is copied from com.intellij.debugger.engine.RemoteDebugProcessHandler#startNotify
// and modified to only terminate on debug detach if myDetachWhenDoneMonitoring is true.
@Override
public void startNotify() {
final DebugProcess debugProcess = DebuggerManager.getInstance(myProject).getDebugProcess(this);
final DebugProcessListener listener = new DebugProcessListener() {
@Override
public void processDetached(DebugProcess process, boolean closedByUser) {
debugProcess.removeDebugProcessListener(this);
if (myDetachWhenDoneMonitoring) {
notifyProcessDetached();
}
}
};
debugProcess.addDebugProcessListener(listener);
try {
super.startNotify();
} finally {
if (debugProcess.isDetached()) {
debugProcess.removeDebugProcessListener(listener);
if (myDetachWhenDoneMonitoring) {
notifyProcessDetached();
}
}
}
}
use of com.intellij.debugger.engine.DebugProcess in project intellij-community by JetBrains.
the class JavaScratchConfiguration method getState.
@Override
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) throws ExecutionException {
final JavaCommandLineState state = new JavaApplicationCommandLineState<JavaScratchConfiguration>(this, env) {
@Override
protected void setupJavaParameters(JavaParameters params) throws ExecutionException {
super.setupJavaParameters(params);
final File scrachesOutput = JavaScratchCompilationSupport.getScratchOutputDirectory(getProject());
if (scrachesOutput != null) {
params.getClassPath().addFirst(FileUtil.toCanonicalPath(scrachesOutput.getAbsolutePath()).replace('/', File.separatorChar));
}
}
@NotNull
@Override
protected OSProcessHandler startProcess() throws ExecutionException {
final OSProcessHandler handler = super.startProcess();
if (getRunnerSettings() instanceof DebuggingRunnerData) {
final VirtualFile vFile = getConfiguration().getScratchVirtualFile();
if (vFile != null) {
DebuggerManager.getInstance(getProject()).addDebugProcessListener(handler, new DebugProcessListener() {
@Override
public void processAttached(DebugProcess process) {
if (vFile.isValid()) {
process.appendPositionManager(new JavaScratchPositionManager((DebugProcessImpl) process, vFile));
}
process.removeDebugProcessListener(this);
}
});
}
}
return handler;
}
};
state.setConsoleBuilder(TextConsoleBuilderFactory.getInstance().createBuilder(getProject(), getConfigurationModule().getSearchScope()));
return state;
}
use of com.intellij.debugger.engine.DebugProcess in project intellij-community by JetBrains.
the class JavaMarkObjectActionHandler method isMarked.
@Override
public boolean isMarked(@NotNull Project project, @NotNull AnActionEvent event) {
final DebuggerTreeNodeImpl node = DebuggerAction.getSelectedNode(event.getDataContext());
if (node == null)
return false;
final NodeDescriptorImpl descriptor = node.getDescriptor();
if (!(descriptor instanceof ValueDescriptor))
return false;
DebugProcess debugProcess = node.getTree().getDebuggerContext().getDebugProcess();
return ((ValueDescriptor) descriptor).getMarkup(debugProcess) != null;
}
use of com.intellij.debugger.engine.DebugProcess in project intellij-community by JetBrains.
the class ConstructorInstancesTracker method obsolete.
public void obsolete() {
if (myNewObjects != null) {
myNewObjects.forEach(ObjectReference::enableCollection);
}
myNewObjects = null;
if (!myIsBackgroundMode || myIsBackgroundTrackingEnabled) {
myBreakpoint.enable();
}
final XDebugSession session = XDebuggerManager.getInstance(myProject).getCurrentSession();
if (session != null) {
final DebugProcess process = DebuggerManager.getInstance(myProject).getDebugProcess(session.getDebugProcess().getProcessHandler());
final MemoryViewDebugProcessData data = process.getUserData(MemoryViewDebugProcessData.KEY);
if (data != null) {
data.getTrackedStacks().release();
}
}
}
Aggregations