Search in sources :

Example 6 with DebugProcess

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);
}
Also used : DebugProcess(com.intellij.debugger.engine.DebugProcess)

Example 7 with DebugProcess

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();
            }
        }
    }
}
Also used : DebugProcess(com.intellij.debugger.engine.DebugProcess) DebugProcessListener(com.intellij.debugger.engine.DebugProcessListener)

Example 8 with DebugProcess

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;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) DebugProcess(com.intellij.debugger.engine.DebugProcess) DebugProcessListener(com.intellij.debugger.engine.DebugProcessListener) OSProcessHandler(com.intellij.execution.process.OSProcessHandler) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File)

Example 9 with DebugProcess

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;
}
Also used : DebugProcess(com.intellij.debugger.engine.DebugProcess) DebuggerTreeNodeImpl(com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl) ValueDescriptor(com.intellij.debugger.ui.tree.ValueDescriptor) NodeDescriptorImpl(com.intellij.debugger.ui.impl.watch.NodeDescriptorImpl)

Example 10 with DebugProcess

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();
        }
    }
}
Also used : MemoryViewDebugProcessData(com.intellij.debugger.memory.component.MemoryViewDebugProcessData) XDebugSession(com.intellij.xdebugger.XDebugSession) DebugProcess(com.intellij.debugger.engine.DebugProcess) ObjectReference(com.sun.jdi.ObjectReference)

Aggregations

DebugProcess (com.intellij.debugger.engine.DebugProcess)18 VirtualMachineProxyImpl (com.intellij.debugger.jdi.VirtualMachineProxyImpl)4 DebugProcessImpl (com.intellij.debugger.engine.DebugProcessImpl)3 DebugProcessListener (com.intellij.debugger.engine.DebugProcessListener)3 DebugEnvironment (com.intellij.debugger.DebugEnvironment)2 EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)2 EvaluationContext (com.intellij.debugger.engine.evaluation.EvaluationContext)2 ExpressionEvaluator (com.intellij.debugger.engine.evaluation.expression.ExpressionEvaluator)2 ClassPrepareRequestor (com.intellij.debugger.requests.ClassPrepareRequestor)2 ExecutionException (com.intellij.execution.ExecutionException)2 RemoteConnection (com.intellij.execution.configurations.RemoteConnection)2 RunContentDescriptor (com.intellij.execution.ui.RunContentDescriptor)2 ReferenceType (com.sun.jdi.ReferenceType)2 Nullable (org.jetbrains.annotations.Nullable)2 DebugUIEnvironment (com.intellij.debugger.DebugUIEnvironment)1 DefaultDebugEnvironment (com.intellij.debugger.DefaultDebugEnvironment)1 SourcePosition (com.intellij.debugger.SourcePosition)1 CompoundPositionManager (com.intellij.debugger.engine.CompoundPositionManager)1 RemoteDebugProcessHandler (com.intellij.debugger.engine.RemoteDebugProcessHandler)1 DebuggerContextImpl (com.intellij.debugger.impl.DebuggerContextImpl)1