internal AD7BoundBreakpoint AddBoundBreakpoint(BoundBreakpoint bp) { lock (_boundBreakpoints) { if (!IsDataBreakpoint && _boundBreakpoints.Find((b) => b.Addr == bp.Addr) != null) { return(null); // already bound to this breakpoint } AD7BreakpointResolution breakpointResolution = new AD7BreakpointResolution(_engine, IsDataBreakpoint, bp.Addr, bp.FunctionName, bp.DocumentContext(_engine)); AD7BoundBreakpoint boundBreakpoint = new AD7BoundBreakpoint(_engine, this, breakpointResolution, bp); //check can bind one last time. If the pending breakpoint was deleted before now, we need to clean up gdb side if (CanBind()) { foreach (var boundBp in _boundBreakpoints.Where((b) => b.Number.Equals(boundBreakpoint.Number, StringComparison.Ordinal)).ToList()) { _engine.Callback.OnBreakpointUnbound(boundBp, enum_BP_UNBOUND_REASON.BPUR_BREAKPOINT_REBIND); _boundBreakpoints.Remove(boundBp); } _boundBreakpoints.Add(boundBreakpoint); PendingBreakpoint.AddedBoundBreakpoint(); _engine.Callback.OnBreakpointBound(boundBreakpoint); } else { boundBreakpoint.Delete(); } return(boundBreakpoint); } }
internal AD7BoundBreakpoint AddBoundBreakpoint(BoundBreakpoint bp) { lock (_boundBreakpoints) { if (_boundBreakpoints.Find((b) => b.Addr == bp.Addr) != null) { return(null); // already bound to this breakpoint } AD7BreakpointResolution breakpointResolution = new AD7BreakpointResolution(_engine, bp.Addr, bp.FunctionName, bp.DocumentContext(_engine)); AD7BoundBreakpoint boundBreakpoint = new AD7BoundBreakpoint(_engine, bp.Addr, this, breakpointResolution, bp); //check can bind one last time. If the pending breakpoint was deleted before now, we need to clean up gdb side if (CanBind()) { _boundBreakpoints.Add(boundBreakpoint); PendingBreakpoint.AddedBoundBreakpoint(); _engine.Callback.OnBreakpointBound(boundBreakpoint); } else { boundBreakpoint.Delete(); } return(boundBreakpoint); } }
internal AD7BoundBreakpoint AddBoundBreakpoint(BoundBreakpoint bp) { lock (_boundBreakpoints) { if (!IsDataBreakpoint && _boundBreakpoints.Find((b) => b.Addr == bp.Addr) != null) { return null; // already bound to this breakpoint } AD7BreakpointResolution breakpointResolution = new AD7BreakpointResolution(_engine, IsDataBreakpoint, bp.Addr, bp.FunctionName, bp.DocumentContext(_engine)); AD7BoundBreakpoint boundBreakpoint = new AD7BoundBreakpoint(_engine, this, breakpointResolution, bp); //check can bind one last time. If the pending breakpoint was deleted before now, we need to clean up gdb side if (CanBind()) { _boundBreakpoints.Add(boundBreakpoint); PendingBreakpoint.AddedBoundBreakpoint(); _engine.Callback.OnBreakpointBound(boundBreakpoint); } else { boundBreakpoint.Delete(); } return boundBreakpoint; } }