public void SetPassCountEqualOrGreater()
        {
            const uint   PASS_COUNT = 5;
            BP_PASSCOUNT passCount;

            passCount.stylePassCount = enum_BP_PASSCOUNT_STYLE.BP_PASSCOUNT_EQUAL_OR_GREATER;
            passCount.dwPassCount    = PASS_COUNT;
            Assert.AreEqual(VSConstants.S_OK, boundBreakpoint.SetPassCount(passCount));
            mockBreakpointLocation.Received(1).SetIgnoreCount(PASS_COUNT - HIT_COUNT - 1);
        }
 public void SetPassCount()
 {
     Assert.AreEqual(AD7Constants.E_BP_DELETED,
                     boundBreakpoint.SetPassCount(new BP_PASSCOUNT()));
 }
Beispiel #3
0
        public void UpdateLocations()
        {
            var  remoteLocations           = new Dictionary <int, SbBreakpointLocation>();
            uint lldbBreakpointLocationNum = _lldbBreakpoint.GetNumLocations();

            for (uint i = 0; i < lldbBreakpointLocationNum; i++)
            {
                SbBreakpointLocation breakpointLocation = _lldbBreakpoint.GetLocationAtIndex(i);
                if (breakpointLocation == null)
                {
                    Trace.WriteLine("Failed to get breakpoint location.");
                    continue;
                }

                remoteLocations.Add(breakpointLocation.GetId(), breakpointLocation);
            }

            foreach (int boundBreakpointId in _boundBreakpoints.Keys.ToList())
            {
                if (!remoteLocations.ContainsKey(boundBreakpointId))
                {
                    _boundBreakpoints[boundBreakpointId].Delete();
                    _boundBreakpoints.Remove(boundBreakpointId);
                }
            }

            List <IDebugBoundBreakpoint2> newLocations = new List <IDebugBoundBreakpoint2>();

            foreach (SbBreakpointLocation remoteLocation in remoteLocations.Values)
            {
                if (!_boundBreakpoints.ContainsKey(remoteLocation.GetId()))
                {
                    // Make sure the newly created bound breakpoints have the same
                    // enabled state as the pending breakpoint.
                    IBoundBreakpoint boundBreakpoint =
                        _debugBoundBreakpointFactory.Create(Self, remoteLocation, _program,
                                                            _requestInfo.guidLanguage);
                    boundBreakpoint.Enable(Convert.ToInt32(_enabled));
                    if (_breakpointCondition.VariableCondition.HasValue)
                    {
                        boundBreakpoint.SetCondition(_breakpointCondition.VariableCondition.Value);
                    }

                    if (_breakpointCondition.PassCount.HasValue)
                    {
                        boundBreakpoint.SetPassCount(_breakpointCondition.PassCount.Value);
                    }

                    _boundBreakpoints.Add(remoteLocation.GetId(), boundBreakpoint);
                    newLocations.Add(boundBreakpoint);
                }
            }

            if (_boundBreakpoints.Count == 0)
            {
                SetError(enum_BP_ERROR_TYPE.BPET_GENERAL_WARNING, _breakpointLocationNotSet);
            }
            else
            {
                _breakpointError = null;
            }

            if (newLocations.Any())
            {
                _breakpointManager.EmitBreakpointBoundEvent(
                    Self, newLocations, _breakpointBoundEnumFactory);
            }
        }