Search in sources :

Example 1 with DartVmServiceSuspendContext

use of com.jetbrains.lang.dart.ide.runner.server.vmService.frame.DartVmServiceSuspendContext in project intellij-plugins by JetBrains.

the class DartVmServiceDebugProcess method startStepOver.

@Override
public void startStepOver(@Nullable XSuspendContext context) {
    if (myLatestCurrentIsolateId != null && mySuspendedIsolateIds.contains(myLatestCurrentIsolateId)) {
        DartVmServiceSuspendContext suspendContext = (DartVmServiceSuspendContext) context;
        final StepOption stepOption = suspendContext != null && suspendContext.getAtAsyncSuspension() ? StepOption.OverAsyncSuspension : StepOption.Over;
        myVmServiceWrapper.resumeIsolate(myLatestCurrentIsolateId, stepOption);
    }
}
Also used : DartVmServiceSuspendContext(com.jetbrains.lang.dart.ide.runner.server.vmService.frame.DartVmServiceSuspendContext)

Example 2 with DartVmServiceSuspendContext

use of com.jetbrains.lang.dart.ide.runner.server.vmService.frame.DartVmServiceSuspendContext in project intellij-plugins by JetBrains.

the class DartVmServiceListener method onIsolatePaused.

void onIsolatePaused(@NotNull final IsolateRef isolateRef, @Nullable final ElementList<Breakpoint> vmBreakpoints, @Nullable final InstanceRef exception, @Nullable final Frame vmTopFrame, boolean atAsyncSuspension) {
    if (vmTopFrame == null) {
        myDebugProcess.getSession().positionReached(new XSuspendContext() {
        });
        return;
    }
    final DartVmServiceSuspendContext suspendContext = new DartVmServiceSuspendContext(myDebugProcess, isolateRef, vmTopFrame, exception, atAsyncSuspension);
    final XStackFrame xTopFrame = suspendContext.getActiveExecutionStack().getTopFrame();
    final XSourcePosition sourcePosition = xTopFrame == null ? null : xTopFrame.getSourcePosition();
    if (vmBreakpoints == null || vmBreakpoints.isEmpty()) {
        final StepOption latestStep = myDebugProcess.getVmServiceWrapper().getLatestStep();
        if (latestStep == StepOption.Over && equalSourcePositions(myLatestSourcePosition, sourcePosition)) {
            // continue stepping to change current line
            myDebugProcess.getVmServiceWrapper().resumeIsolate(isolateRef.getId(), latestStep);
        } else {
            myLatestSourcePosition = sourcePosition;
            myDebugProcess.getSession().positionReached(suspendContext);
        }
    } else {
        if (vmBreakpoints.size() > 1) {
            // Shouldn't happen. IDE doesn't allow to set 2 breakpoints on one line.
            LOG.error(vmBreakpoints.size() + " breakpoints hit in one shot.");
        }
        // Remove any temporary (run to cursor) breakpoints.
        myBreakpointHandler.removeTemporaryBreakpoints(isolateRef.getId());
        final XLineBreakpoint<XBreakpointProperties> xBreakpoint = myBreakpointHandler.getXBreakpoint(vmBreakpoints.get(0));
        if (xBreakpoint == null) {
            // breakpoint could be set in the Observatory
            myLatestSourcePosition = sourcePosition;
            myDebugProcess.getSession().positionReached(suspendContext);
            return;
        }
        if ("false".equals(evaluateExpression(isolateRef.getId(), vmTopFrame, xBreakpoint.getConditionExpression()))) {
            myDebugProcess.getVmServiceWrapper().resumeIsolate(isolateRef.getId(), null);
            return;
        }
        myLatestSourcePosition = sourcePosition;
        final String logExpression = evaluateExpression(isolateRef.getId(), vmTopFrame, xBreakpoint.getLogExpressionObject());
        final boolean suspend = myDebugProcess.getSession().breakpointReached(xBreakpoint, logExpression, suspendContext);
        if (!suspend) {
            myDebugProcess.getVmServiceWrapper().resumeIsolate(isolateRef.getId(), null);
        }
    }
}
Also used : XBreakpointProperties(com.intellij.xdebugger.breakpoints.XBreakpointProperties) DartVmServiceSuspendContext(com.jetbrains.lang.dart.ide.runner.server.vmService.frame.DartVmServiceSuspendContext) XSuspendContext(com.intellij.xdebugger.frame.XSuspendContext) XSourcePosition(com.intellij.xdebugger.XSourcePosition) XStackFrame(com.intellij.xdebugger.frame.XStackFrame)

Example 3 with DartVmServiceSuspendContext

use of com.jetbrains.lang.dart.ide.runner.server.vmService.frame.DartVmServiceSuspendContext in project flutter-intellij by flutter.

the class DartVmServiceDebugProcessZ method startStepOver.

@Override
public void startStepOver(@Nullable XSuspendContext context) {
    if (myLatestCurrentIsolateId != null && mySuspendedIsolateIds.contains(myLatestCurrentIsolateId)) {
        final DartVmServiceSuspendContext suspendContext = (DartVmServiceSuspendContext) context;
        final StepOption stepOption = suspendContext != null && suspendContext.getAtAsyncSuspension() ? StepOption.OverAsyncSuspension : StepOption.Over;
        myVmServiceWrapper.resumeIsolate(myLatestCurrentIsolateId, stepOption);
    }
}
Also used : DartVmServiceSuspendContext(com.jetbrains.lang.dart.ide.runner.server.vmService.frame.DartVmServiceSuspendContext)

Aggregations

DartVmServiceSuspendContext (com.jetbrains.lang.dart.ide.runner.server.vmService.frame.DartVmServiceSuspendContext)3 XSourcePosition (com.intellij.xdebugger.XSourcePosition)1 XBreakpointProperties (com.intellij.xdebugger.breakpoints.XBreakpointProperties)1 XStackFrame (com.intellij.xdebugger.frame.XStackFrame)1 XSuspendContext (com.intellij.xdebugger.frame.XSuspendContext)1