Exemplo n.º 1
0
 int IDebugEngine2.CauseBreak()
 {
     ThrowIfDisposed();
     DebugSession.BreakAsync()
     .SilenceException <MessageTransportException>()
     .SilenceException <RException>()
     .DoNotWait();
     return(VSConstants.S_OK);
 }
Exemplo n.º 2
0
        public async Task BreakContinue()
        {
            const string code =
                @"browser()
  x <- 0
  while (x >= 0) {
    x <- x + 1
  }
  browser()";

            using (var debugSession = new DebugSession(_session))
                using (var sf = new SourceFile(code)) {
                    await sf.Source(_session);

                    await debugSession.NextPromptShouldBeBrowseAsync();

                    await debugSession.ContinueAsync();

                    await Task.Delay(100);

                    await debugSession.BreakAsync();

                    await debugSession.NextPromptShouldBeBrowseAsync();

                    (await debugSession.GetStackFramesAsync()).Should().HaveTail(new MatchDebugStackFrames {
                        { sf, new MatchRange <int>(1, 3) }
                    });

                    await _session.EvaluateAsync("x <- -42", REvaluationKind.Mutating);

                    await debugSession.ContinueAsync();

                    await debugSession.NextPromptShouldBeBrowseAsync();

                    (await debugSession.GetStackFramesAsync()).Should().HaveTail(new MatchDebugStackFrames {
                        { sf, 6 }
                    });
                }
        }