Search in sources :

Example 1 with StepIntoBreakpoint

use of com.intellij.debugger.ui.breakpoints.StepIntoBreakpoint in project intellij-community by JetBrains.

the class LambdaAsyncMethodFilter method onReached.

@Override
public int onReached(SuspendContextImpl context, RequestHint hint) {
    try {
        StackFrameProxyImpl proxy = context.getFrameProxy();
        if (proxy != null) {
            Value lambdaReference = ContainerUtil.getOrElse(proxy.getArgumentValues(), myParamNo, null);
            if (lambdaReference instanceof ObjectReference) {
                final SourcePosition pos = myMethodFilter.getBreakpointPosition();
                if (pos != null) {
                    Project project = context.getDebugProcess().getProject();
                    long lambdaId = ((ObjectReference) lambdaReference).uniqueID();
                    StepIntoBreakpoint breakpoint = new LambdaInstanceBreakpoint(project, lambdaId, pos, myMethodFilter);
                    ClassInstanceMethodFilter.setUpStepIntoBreakpoint(context, breakpoint, hint);
                    return RequestHint.RESUME;
                }
            }
        }
    } catch (EvaluateException ignore) {
    }
    return RequestHint.STOP;
}
Also used : StackFrameProxyImpl(com.intellij.debugger.jdi.StackFrameProxyImpl) Project(com.intellij.openapi.project.Project) EvaluateException(com.intellij.debugger.engine.evaluation.EvaluateException) ObjectReference(com.sun.jdi.ObjectReference) SourcePosition(com.intellij.debugger.SourcePosition) Value(com.sun.jdi.Value) StepIntoBreakpoint(com.intellij.debugger.ui.breakpoints.StepIntoBreakpoint)

Example 2 with StepIntoBreakpoint

use of com.intellij.debugger.ui.breakpoints.StepIntoBreakpoint 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)

Aggregations

EvaluateException (com.intellij.debugger.engine.evaluation.EvaluateException)2 StackFrameProxyImpl (com.intellij.debugger.jdi.StackFrameProxyImpl)2 StepIntoBreakpoint (com.intellij.debugger.ui.breakpoints.StepIntoBreakpoint)2 ObjectReference (com.sun.jdi.ObjectReference)2 SourcePosition (com.intellij.debugger.SourcePosition)1 Project (com.intellij.openapi.project.Project)1 Value (com.sun.jdi.Value)1