Example #1
0
            internal void RemoveAllBoundBreakpoints_DbgThread(DbgRuntime runtime)
            {
                Dispatcher.VerifyAccess();
                var boundBreakpoints = BoundCodeBreakpointsService.RemoveBoundBreakpoints_DbgThread(runtime);

                foreach (var bp in boundBreakpoints)
                {
                    bp.Close(Dispatcher);
                }
            }
Example #2
0
            internal void RemoveBoundCodeBreakpoints_DbgThread(DbgRuntimeImpl runtime, DbgEngineBoundCodeBreakpointImpl[] breakpoints)
            {
                Dispatcher.VerifyAccess();
                Debug.Assert(IsOurEngine(runtime.Engine));
                if (!owner.IsOurEngine(runtime.Engine))
                {
                    foreach (var bp in breakpoints)
                    {
                        bp.BoundCodeBreakpoint.Close(Dispatcher);
                    }
                    return;
                }
                var bps = breakpoints.Select(a => a.BoundCodeBreakpoint).ToArray();

                BoundCodeBreakpointsService.RemoveBoundBreakpoints_DbgThread(bps);
                foreach (var bp in bps)
                {
                    bp.Close(Dispatcher);
                }
            }
Example #3
0
            internal void AddBoundCodeBreakpoints_DbgThread(DbgRuntimeImpl runtime, DbgEngineBoundCodeBreakpointImpl[] breakpoints)
            {
                Dispatcher.VerifyAccess();
                Debug.Assert(IsOurEngine(runtime.Engine));
                if (!IsOurEngine(runtime.Engine))
                {
                    foreach (var bp in breakpoints)
                    {
                        bp.BoundCodeBreakpoint.Close(Dispatcher);
                    }
                    return;
                }

                var bpsToKeep = new List <DbgBoundCodeBreakpoint>(breakpoints.Length);

                foreach (var bp in breakpoints)
                {
                    var bound = bp.BoundCodeBreakpoint;
                    if (bound.Runtime.IsClosed || bound.Module?.IsClosed == true || bound.Breakpoint.IsClosed)
                    {
                        bound.Close(Dispatcher);
                    }
                    else
                    {
                        bpsToKeep.Add(bound);
                    }
                }

                if (bpsToKeep.Count > 0)
                {
                    var objsToClose = BoundCodeBreakpointsService.AddBoundBreakpoints_DbgThread(bpsToKeep);
                    foreach (var bp in objsToClose)
                    {
                        bp.Close(Dispatcher);
                    }
                }
            }