Exemple #1
0
        public ContinueCommand(int id, SteppingKind stepping, int stepCount = 1) : base(id, "continue")
        {
            switch (stepping)
            {
            case SteppingKind.Into:
                this._arguments = new Dictionary <string, object> {
                    { "stepaction", "in" },
                    { "stepcount", stepCount }
                };
                break;

            case SteppingKind.Out:
                this._arguments = new Dictionary <string, object> {
                    { "stepaction", "out" },
                    { "stepcount", stepCount }
                };
                break;

            case SteppingKind.Over:
                this._arguments = new Dictionary <string, object> {
                    { "stepaction", "next" },
                    { "stepcount", stepCount }
                };
                break;
            }
        }
        public void CreateContinueCommand()
        {
            // Arrange
            const int          commandId = 3;
            const SteppingKind stepping  = SteppingKind.Out;

            // Act
            var continueCommand = new ContinueCommand(commandId, stepping);

            // Assert
            Assert.AreEqual(commandId, continueCommand.Id);
            Assert.AreEqual(
                string.Format(
                    "{{\"command\":\"continue\",\"seq\":{0},\"type\":\"request\",\"arguments\":{{\"stepaction\":\"{1}\",\"stepcount\":1}}}}",
                    commandId, stepping.ToString().ToLower()),
                continueCommand.ToString());
        }
        public void CreateContinueCommandWithOptionalParameters()
        {
            // Arrange
            const int          commandId = 3;
            const SteppingKind stepping  = SteppingKind.Out;
            const int          stepCount = 3;

            // Act
            var continueCommand = new ContinueCommand(commandId, stepping, stepCount);

            // Assert
            Assert.AreEqual(commandId, continueCommand.Id);
            Assert.AreEqual(
                string.Format(
                    "{{\"command\":\"continue\",\"seq\":{0},\"type\":\"request\",\"arguments\":{{\"stepaction\":\"{1}\",\"stepcount\":{2}}}}}",
                    commandId, stepping.ToString().ToLower(CultureInfo.InvariantCulture), stepCount),
                continueCommand.ToString());
        }
        public ContinueCommand(int id, SteppingKind stepping, int stepCount = 1) : base(id, "continue") {
            switch (stepping) {
                case SteppingKind.Into:
                    _arguments = new Dictionary<string, object> {
                        { "stepaction", "in" },
                        { "stepcount", stepCount }
                    };
                    break;

                case SteppingKind.Out:
                    _arguments = new Dictionary<string, object> {
                        { "stepaction", "out" },
                        { "stepcount", stepCount }
                    };
                    break;

                case SteppingKind.Over:
                    _arguments = new Dictionary<string, object> {
                        { "stepaction", "next" },
                        { "stepcount", stepCount }
                    };
                    break;
            }
        }
        private async Task ContinueAsync(SteppingKind stepping = SteppingKind.None, int stepCount = 1, CancellationToken cancellationToken = new CancellationToken()) {
            // Ensure load complete and entrypoint breakpoint/tracepoint handling disabled after first real continue
            _loadCompleteHandled = true;
            _handleEntryPointHit = false;

            var continueCommand = new ContinueCommand(CommandId, stepping, stepCount);
            await TrySendRequestAsync(continueCommand, cancellationToken).ConfigureAwait(false);
        }
        private Task ContinueAndSaveSteppingAsync(SteppingKind steppingKind, bool resetSteppingMode = true, int stepCount = 1, CancellationToken cancellationToken = new CancellationToken()) {
            if (resetSteppingMode) {
                _steppingMode = steppingKind;
                _steppingCallstackDepth = MainThread.CallstackDepth;
            }

            return ContinueAsync(steppingKind, stepCount, cancellationToken);
        }