Exemplo n.º 1
0
 /// <summary>
 /// Remove the given breakpoint from the list of maintained breakpoints.
 /// </summary>
 private void Remove(DalvikBreakpoint breakpoint)
 {
     lock (dataLock)
     {
         breakpoints.Remove(breakpoint);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Add the given breakpoint to the list of maintained breakpoints.
 /// </summary>
 private void Add(DalvikBreakpoint breakpoint)
 {
     lock (dataLock)
     {
         breakpoints.Add(breakpoint);
     }
 }
Exemplo n.º 3
0
        /// <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)));
        }
Exemplo n.º 4
0
 /// <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);
     }
 }
Exemplo n.º 5
0
 /// <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);
     }
 }
Exemplo n.º 6
0
        /// <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)));
        }
Exemplo n.º 7
0
 /// <summary>
 /// The given breakpoint has been clear by the VM.
 /// Now remove from the list.
 /// </summary>
 protected virtual void OnReset(DalvikBreakpoint breakpoint)
 {
     Remove(breakpoint);
 }
Exemplo n.º 8
0
 /// <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)));
 }