Пример #1
0
        public virtual Breakpoint[] SetMachineBreakpoints(Breakpoint[] breaksToSet)
        {
            var confirmedBreakpoints = new List <Breakpoint>();

            var grouped = breaksToSet.GroupBy(g => g.Source);

            foreach (var item in grouped)
            {
                var lines = item
                            .Where(x => x.Line != 0)
                            .Select(x => x.Line)
                            .ToArray();

                _breakpointManager.SetLineStops(item.Key, lines);
                foreach (var line in lines)
                {
                    confirmedBreakpoints.Add(new Breakpoint()
                    {
                        Line   = line,
                        Source = item.Key
                    });
                }
            }

            // Уведомить все потоки о новых точках остановки
            foreach (var machine in _threadManager.GetAllTokens().Select(x => x.Machine))
            {
                machine.SetDebugMode(_breakpointManager);
            }

            return(confirmedBreakpoints.ToArray());
        }