/// <summary> /// Remove the given breakpoint from the list of maintained breakpoints. /// </summary> private void Remove(DalvikBreakpoint breakpoint) { lock (dataLock) { breakpoints.Remove(breakpoint); } }
/// <summary> /// Add the given breakpoint to the list of maintained breakpoints. /// </summary> private void Add(DalvikBreakpoint breakpoint) { lock (dataLock) { breakpoints.Add(breakpoint); } }
/// <summary> /// set the existing breakpoint. /// </summary> /// <param name="bp"></param> public Task <bool> SetBreakpoint(DalvikBreakpoint bp) { // Record breakpoint Add(bp); // Try to bind now return(Task.Factory.StartNew(() => bp.TryBind(process))); }
/// <summary> /// Try to get a breakpoint by it's request id. /// </summary> private bool TryGet(int requestId, out DalvikBreakpoint breakpoint) { lock (dataLock) { breakpoint = breakpoints.FirstOrDefault(x => x.RequestId == requestId); return(breakpoint != null); } }
/// <summary> /// The given breakpoint has been clear by the VM. /// Now remove from the list. /// </summary> protected override void OnReset(DalvikBreakpoint breakpoint) { var bp = breakpoint as IDebugBreakpoint; // is this one of our breakpoints? if (bp != null) { // Notify VS bp.BoundBreakpoint.OnReset(); eventCallback.Send(Program, new BreakpointUnboundEvent(bp.BoundBreakpoint)); // Remove from list base.OnReset(breakpoint); } }
/// <summary> /// Process all events with given request id that are pending. /// </summary> internal void ProcessPendingEvents(DalvikBreakpoint breakpoint) { List <Breakpoint> events; lock (dataLock) { var requestId = breakpoint.RequestId; events = pendingEvents.Where(x => x.RequestId == requestId).ToList(); events.ForEach(x => pendingEvents.Remove(x)); } // Process pending events now events.ForEach(x => Task.Factory.StartNew(() => breakpoint.OnTrigger(x))); }
/// <summary> /// The given breakpoint has been clear by the VM. /// Now remove from the list. /// </summary> protected virtual void OnReset(DalvikBreakpoint breakpoint) { Remove(breakpoint); }
/// <summary> /// Clear the given breakpoint and remove from my list. /// </summary> public Task ResetAsync(DalvikBreakpoint breakpoint) { return(process.Debugger.EventRequest.ClearAsync(breakpoint.EventKind, breakpoint.RequestId).ContinueWith(t => OnReset(breakpoint))); }