public void GetCurrentState(IVariableEntryInternal child, Action <DEBUG_PROPERTY_INFO> callback) { int index = _childToIndex[child]; if (index != _currentBatchIndex) { HResultChecker.Check(_childEnum.Reset()); HResultChecker.Check(_childEnum.Skip((uint)index)); _currentBatchIndex = index; } if (_currentBatch.Count == 0) { int toFetch = Math.Max(0, Math.Min(_batchSize, _totalChildCount - _currentBatchIndex)); var propertyInfos = new DEBUG_PROPERTY_INFO[toFetch]; uint numFetched; HResultChecker.Check( _childEnum.Next((uint)toFetch, propertyInfos, out numFetched)); propertyInfos.ForEach(info => _currentBatch.Enqueue(info)); } _currentBatchIndex++; callback(_currentBatch.Dequeue()); }
public void GetCurrentState( IVariableEntryInternal varEntry, Action <DEBUG_PROPERTY_INFO> callback) { IDebugExpression2 debugExpression = ParseExpression(_varEntryToExpression[varEntry]); IDebugProperty2 debugProperty = EvaluateExpression(debugExpression); DEBUG_PROPERTY_INFO propertyInfo = GetPropertyInfo(debugProperty); callback(propertyInfo); }
public IVariableEntry AddWatch(string expression) { if (_debugSessionContext.ProgramState == ProgramState.Terminated) { throw new InvalidOperationException( $"Cannot add the watch ({expression}); " + $"program state = {_debugSessionContext.ProgramState}"); } // If this class starts using the decorator pattern, the below use of `this` will need // to be reviewed. IVariableEntryInternal watch = _variableEntryFactory.Create(this); _varEntryToExpression[watch] = expression; _watchEntries.Add(watch); // TODO: Watch window should update its entries the same way as // vanilla VS. if (_debugSessionContext.ProgramState == ProgramState.AtBreak) { watch.Refresh(); } return(watch); }