Search in sources :

Example 16 with StackFrameProxyImpl

use of com.intellij.debugger.jdi.StackFrameProxyImpl in project intellij-community by JetBrains.

the class DebuggerTestCase method createEvaluationContext.

protected EvaluationContextImpl createEvaluationContext(final SuspendContextImpl suspendContext) {
    try {
        StackFrameProxyImpl proxy = suspendContext.getFrameProxy();
        assertNotNull(proxy);
        return new EvaluationContextImpl(suspendContext, proxy, proxy.thisObject());
    } catch (EvaluateException e) {
        error(e);
        return null;
    }
}
Also used : StackFrameProxyImpl(com.intellij.debugger.jdi.StackFrameProxyImpl) EvaluateException(com.intellij.debugger.engine.evaluation.EvaluateException) EvaluationContextImpl(com.intellij.debugger.engine.evaluation.EvaluationContextImpl)

Example 17 with StackFrameProxyImpl

use of com.intellij.debugger.jdi.StackFrameProxyImpl in project intellij-community by JetBrains.

the class ClassInstanceMethodFilter method onReached.

@Override
public int onReached(SuspendContextImpl context, RequestHint hint) {
    StackFrameProxyImpl proxy = context.getFrameProxy();
    if (proxy != null) {
        try {
            ObjectReference reference = proxy.thisObject();
            if (reference != null) {
                StepIntoBreakpoint breakpoint = DebuggerManagerEx.getInstanceEx(context.getDebugProcess().getProject()).getBreakpointManager().addStepIntoBreakpoint(myMethodFilter);
                if (breakpoint != null) {
                    breakpoint.addInstanceFilter(reference.uniqueID());
                    breakpoint.setInstanceFiltersEnabled(true);
                    setUpStepIntoBreakpoint(context, breakpoint, hint);
                    return RequestHint.RESUME;
                }
            }
        } catch (EvaluateException ignored) {
        }
    }
    return RequestHint.STOP;
}
Also used : StackFrameProxyImpl(com.intellij.debugger.jdi.StackFrameProxyImpl) EvaluateException(com.intellij.debugger.engine.evaluation.EvaluateException) ObjectReference(com.sun.jdi.ObjectReference) StepIntoBreakpoint(com.intellij.debugger.ui.breakpoints.StepIntoBreakpoint)

Example 18 with StackFrameProxyImpl

use of com.intellij.debugger.jdi.StackFrameProxyImpl 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 19 with StackFrameProxyImpl

use of com.intellij.debugger.jdi.StackFrameProxyImpl in project intellij-community by JetBrains.

the class PopFrameAction method update.

public void update(@NotNull AnActionEvent e) {
    boolean enable = false;
    StackFrameProxyImpl proxy = getStackFrameProxy(e);
    if (proxy != null && !proxy.isBottom()) /*&& isAtBreakpoint(e)*/
    {
        enable = proxy.getVirtualMachine().canPopFrames();
    }
    if (ActionPlaces.isMainMenuOrActionSearch(e.getPlace()) || ActionPlaces.DEBUGGER_TOOLBAR.equals(e.getPlace())) {
        e.getPresentation().setEnabled(enable);
    } else {
        e.getPresentation().setVisible(enable);
    }
}
Also used : StackFrameProxyImpl(com.intellij.debugger.jdi.StackFrameProxyImpl)

Example 20 with StackFrameProxyImpl

use of com.intellij.debugger.jdi.StackFrameProxyImpl in project intellij-community by JetBrains.

the class LineBreakpoint method calculateEventClass.

@Override
protected String calculateEventClass(EvaluationContextImpl context, LocatableEvent event) throws EvaluateException {
    String className = null;
    final ObjectReference thisObject = (ObjectReference) context.getThisObject();
    if (thisObject != null) {
        className = thisObject.referenceType().name();
    } else {
        final StackFrameProxyImpl frame = context.getFrameProxy();
        if (frame != null) {
            className = frame.location().declaringType().name();
        }
    }
    return className;
}
Also used : StackFrameProxyImpl(com.intellij.debugger.jdi.StackFrameProxyImpl)

Aggregations

StackFrameProxyImpl (com.intellij.debugger.jdi.StackFrameProxyImpl)21 EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)14 Nullable (org.jetbrains.annotations.Nullable)6 SourcePosition (com.intellij.debugger.SourcePosition)5 DebugProcessImpl (com.intellij.debugger.engine.DebugProcessImpl)5 SuspendContextImpl (com.intellij.debugger.engine.SuspendContextImpl)4 DebuggerContextImpl (com.intellij.debugger.impl.DebuggerContextImpl)4 Project (com.intellij.openapi.project.Project)4 EvaluationContextImpl (com.intellij.debugger.engine.evaluation.EvaluationContextImpl)3 ExpressionEvaluator (com.intellij.debugger.engine.evaluation.expression.ExpressionEvaluator)3 Location (com.sun.jdi.Location)3 ObjectReference (com.sun.jdi.ObjectReference)3 DebuggerContextCommandImpl (com.intellij.debugger.engine.events.DebuggerContextCommandImpl)2 DebuggerUtilsEx (com.intellij.debugger.impl.DebuggerUtilsEx)2 ThreadReferenceProxyImpl (com.intellij.debugger.jdi.ThreadReferenceProxyImpl)2 Computable (com.intellij.openapi.util.Computable)2 com.intellij.psi (com.intellij.psi)2 PsiElement (com.intellij.psi.PsiElement)2 ThreeState (com.intellij.util.ThreeState)2 Method (com.sun.jdi.Method)2