Search in sources :

Example 31 with DebuggerContextImpl

use of com.intellij.debugger.impl.DebuggerContextImpl in project intellij-community by JetBrains.

the class JvmSmartStepIntoActionHandler method perform.

public void perform(@NotNull final Project project, final AnActionEvent event) {
    final DebuggerContextImpl debuggerContext = (DebuggerManagerEx.getInstanceEx(project)).getContext();
    final DebuggerSession session = debuggerContext.getDebuggerSession();
    if (session != null) {
        doStep(project, debuggerContext.getSourcePosition(), session);
    }
}
Also used : DebuggerSession(com.intellij.debugger.impl.DebuggerSession) DebuggerContextImpl(com.intellij.debugger.impl.DebuggerContextImpl)

Example 32 with DebuggerContextImpl

use of com.intellij.debugger.impl.DebuggerContextImpl in project intellij-community by JetBrains.

the class JavaWithRuntimeCastSurrounder method surroundExpression.

public TextRange surroundExpression(Project project, Editor editor, PsiExpression expr) throws IncorrectOperationException {
    DebuggerContextImpl debuggerContext = (DebuggerManagerEx.getInstanceEx(project)).getContext();
    DebuggerSession debuggerSession = debuggerContext.getDebuggerSession();
    if (debuggerSession != null) {
        final ProgressWindowWithNotification progressWindow = new ProgressWindowWithNotification(true, expr.getProject());
        SurroundWithCastWorker worker = new SurroundWithCastWorker(editor, expr, debuggerContext, progressWindow);
        progressWindow.setTitle(DebuggerBundle.message("title.evaluating"));
        debuggerContext.getDebugProcess().getManagerThread().startProgress(worker, progressWindow);
    }
    return null;
}
Also used : DebuggerSession(com.intellij.debugger.impl.DebuggerSession) ProgressWindowWithNotification(com.intellij.openapi.progress.util.ProgressWindowWithNotification) DebuggerContextImpl(com.intellij.debugger.impl.DebuggerContextImpl)

Example 33 with DebuggerContextImpl

use of com.intellij.debugger.impl.DebuggerContextImpl in project intellij-community by JetBrains.

the class AddSteppingFilterAction method actionPerformed.

public void actionPerformed(final AnActionEvent e) {
    final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
    DebugProcessImpl process = debuggerContext.getDebugProcess();
    if (process == null) {
        return;
    }
    final StackFrameProxyImpl proxy = PopFrameAction.getStackFrameProxy(e);
    process.getManagerThread().schedule(new DebuggerCommandImpl() {

        protected void action() throws Exception {
            final String name = getClassName(proxy != null ? proxy : debuggerContext.getFrameProxy());
            if (name == null) {
                return;
            }
            final Project project = e.getData(CommonDataKeys.PROJECT);
            ApplicationManager.getApplication().invokeLater(() -> {
                String filter = Messages.showInputDialog(project, "", "Add Stepping Filter", null, name, null);
                if (filter != null) {
                    ClassFilter[] newFilters = ArrayUtil.append(DebuggerSettings.getInstance().getSteppingFilters(), new ClassFilter(filter));
                    DebuggerSettings.getInstance().setSteppingFilters(newFilters);
                }
            });
        }
    });
}
Also used : StackFrameProxyImpl(com.intellij.debugger.jdi.StackFrameProxyImpl) Project(com.intellij.openapi.project.Project) DebuggerCommandImpl(com.intellij.debugger.engine.events.DebuggerCommandImpl) DebugProcessImpl(com.intellij.debugger.engine.DebugProcessImpl) ClassFilter(com.intellij.ui.classFilter.ClassFilter) DebuggerContextImpl(com.intellij.debugger.impl.DebuggerContextImpl) EvaluateException(com.intellij.debugger.engine.evaluation.EvaluateException)

Example 34 with DebuggerContextImpl

use of com.intellij.debugger.impl.DebuggerContextImpl in project intellij-community by JetBrains.

the class AutoRendererAction method actionPerformed.

public void actionPerformed(@NotNull final AnActionEvent e) {
    final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
    final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
    if (debugProcess != null) {
        final List<JavaValue> selectedValues = ViewAsGroup.getSelectedValues(e);
        if (!selectedValues.isEmpty()) {
            debugProcess.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {

                public void threadAction() {
                    for (JavaValue selectedValue : selectedValues) {
                        selectedValue.getDescriptor().setRenderer(null);
                    }
                    DebuggerAction.refreshViews(e);
                }
            });
        }
    }
}
Also used : DebugProcessImpl(com.intellij.debugger.engine.DebugProcessImpl) JavaValue(com.intellij.debugger.engine.JavaValue) DebuggerContextImpl(com.intellij.debugger.impl.DebuggerContextImpl) DebuggerContextCommandImpl(com.intellij.debugger.engine.events.DebuggerContextCommandImpl)

Example 35 with DebuggerContextImpl

use of com.intellij.debugger.impl.DebuggerContextImpl in project intellij-community by JetBrains.

the class DebuggerTreeNodeImpl method calcValue.

public void calcValue() {
    final DebuggerContextImpl context = getTree().getDebuggerContext();
    update(context, () -> {
        EvaluationContextImpl evaluationContext = context.createEvaluationContext();
        getDescriptor().setContext(evaluationContext);
        getDescriptor().updateRepresentation(evaluationContext, new DescriptorLabelListener() {

            @Override
            public void labelChanged() {
                updateCaches();
                DebuggerTreeNodeImpl.this.labelChanged();
            }
        });
        childrenChanged(true);
    }, false);
}
Also used : EvaluationContextImpl(com.intellij.debugger.engine.evaluation.EvaluationContextImpl) DebuggerContextImpl(com.intellij.debugger.impl.DebuggerContextImpl) DescriptorLabelListener(com.intellij.debugger.ui.tree.render.DescriptorLabelListener)

Aggregations

DebuggerContextImpl (com.intellij.debugger.impl.DebuggerContextImpl)42 DebugProcessImpl (com.intellij.debugger.engine.DebugProcessImpl)20 DebuggerSession (com.intellij.debugger.impl.DebuggerSession)12 Project (com.intellij.openapi.project.Project)12 DebuggerContextCommandImpl (com.intellij.debugger.engine.events.DebuggerContextCommandImpl)11 DebuggerTreeNodeImpl (com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl)11 EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)10 JavaValue (com.intellij.debugger.engine.JavaValue)9 DebuggerCommandImpl (com.intellij.debugger.engine.events.DebuggerCommandImpl)8 NotNull (org.jetbrains.annotations.NotNull)7 EvaluationContextImpl (com.intellij.debugger.engine.evaluation.EvaluationContextImpl)6 SourcePosition (com.intellij.debugger.SourcePosition)5 JavaValueModifier (com.intellij.debugger.engine.JavaValueModifier)5 SuspendContextImpl (com.intellij.debugger.engine.SuspendContextImpl)5 NodeDescriptorImpl (com.intellij.debugger.ui.impl.watch.NodeDescriptorImpl)5 ThreadReferenceProxyImpl (com.intellij.debugger.jdi.ThreadReferenceProxyImpl)4 ValueDescriptor (com.intellij.debugger.ui.tree.ValueDescriptor)4 List (java.util.List)4 StackFrameProxyImpl (com.intellij.debugger.jdi.StackFrameProxyImpl)3 ThreadDescriptorImpl (com.intellij.debugger.ui.impl.watch.ThreadDescriptorImpl)3