Пример #1
0
        /// <summary>
        /// Lists breakpoints from the debugger API.  Stale breakpoints are removed,
        /// new breakpoints are sent to the <see cref="IBreakpointServer"/> and
        /// breakpoints that cannot be processed are returned with an error.
        /// </summary>
        internal override void MainAction()
        {
            var serverBreakpoints = _client.ListBreakpoints();

            if (serverBreakpoints == null)
            {
                return;
            }
            var bpmResponse = _breakpointManager.UpdateBreakpoints(serverBreakpoints);

            foreach (var breakpointToBeRemoved in bpmResponse.Removed)
            {
                var breakpoint = breakpointToBeRemoved.Convert();
                breakpoint.Activated = false;
                _server.WriteBreakpointAsync(breakpoint).Wait();
            }

            foreach (var breakpoint in bpmResponse.New)
            {
                if (breakpoint.Action == Debugger.V2.Breakpoint.Types.Action.Log)
                {
                    breakpoint.Status = Common.CreateStatusMessage(
                        Messages.LogPointNotSupported, isError: true);
                    breakpoint.IsFinalState = true;
                    _client.UpdateBreakpoint(breakpoint);
                }
                else
                {
                    _server.WriteBreakpointAsync(breakpoint.Convert()).Wait();
                }
            }
        }
        /// <summary>
        /// Lists breakpoints from the debugger API.  Stale breakpoints are removed,
        /// new breakpoints are sent to the <see cref="IBreakpointServer"/> and
        /// breakpoints that cannot be processed are returned with an error.
        /// </summary>
        internal override void MainAction()
        {
            var serverBreakpoints = _client.ListBreakpoints();

            if (serverBreakpoints == null)
            {
                return;
            }
            var bpmResponse = _breakpointManager.UpdateBreakpoints(serverBreakpoints);

            foreach (var breakpointToBeRemoved in bpmResponse.Removed)
            {
                var breakpoint = breakpointToBeRemoved.Convert();
                breakpoint.Activated = false;
                _server.WriteBreakpointAsync(breakpoint).Wait();
            }

            foreach (var breakpoint in bpmResponse.New)
            {
                _server.WriteBreakpointAsync(breakpoint.Convert()).Wait();
            }
        }