Ejemplo n.º 1
0
        public override DbgDotNetValueNode[] GetChildren(DbgEvaluationInfo evalInfo, ulong index, int count, DbgValueNodeEvaluationOptions options)
        {
            var res = new DbgDotNetValueNode[count];

            try {
                for (int i = 0, j = (int)index; i < count; i++, j++)
                {
                    res[i] = new TypeVariableValueNode(valueNodeFactory, typeVariableInfos[j]);
                }
            }
            catch {
                evalInfo.Context.Process.DbgManager.Close(res.Where(a => a != null));
                throw;
            }
            return(res);
        }
Ejemplo n.º 2
0
        public override DbgDotNetValueNode[] GetChildren(LanguageValueNodeFactory valueNodeFactory, DbgEvaluationInfo evalInfo, ulong index, int count, DbgValueNodeEvaluationOptions options, ReadOnlyCollection <string> formatSpecifiers)
        {
            if (count == 0)
            {
                return(Array.Empty <DbgDotNetValueNode>());
            }

            var   first      = providers[0];
            ulong childCount = first.GetChildCount(evalInfo);

            if (index + (uint)count <= childCount)
            {
                return(first.GetChildren(valueNodeFactory, evalInfo, index, count, options, formatSpecifiers));
            }

            var res = new DbgDotNetValueNode[count];

            try {
                int w = 0;
                if (index < childCount)
                {
                    var tmp = first.GetChildren(valueNodeFactory, evalInfo, index, (int)(childCount - index), options, formatSpecifiers);
                    Array.Copy(tmp, res, tmp.Length);
                    w += tmp.Length;
                }
                for (int i = (int)(index - childCount) + 1; i < providers.Length && w < count; i++)
                {
                    evalInfo.CancellationToken.ThrowIfCancellationRequested();
                    var provider = providers[i];
                    res[w++] = valueNodeFactory.Create(evalInfo, provider.Name, provider, formatSpecifiers, options, provider.Expression, provider.ImageName, provider.ValueText);
                }
                if (w != res.Length)
                {
                    throw new InvalidOperationException();
                }
                return(res);
            }
            catch {
                evalInfo.Context.Runtime.Process.DbgManager.Close(res.Where(a => a != null));
                throw;
            }
        }