Example #1
0
 DbgEngineValueNode[] GetChildrenCore(DbgEvaluationContext context, DbgStackFrame frame, ulong index, int count, DbgValueNodeEvaluationOptions options, CancellationToken cancellationToken)
 {
     DbgEngineValueNode[] res     = null;
     DbgDotNetValueNode[] dnNodes = null;
     try {
         dnNodes = dnValueNode.GetChildren(context, frame, index, count, options, cancellationToken);
         res     = new DbgEngineValueNode[dnNodes.Length];
         for (int i = 0; i < res.Length; i++)
         {
             cancellationToken.ThrowIfCancellationRequested();
             res[i] = owner.Create(dnNodes[i]);
         }
     }
     catch (Exception ex) {
         if (res != null)
         {
             context.Runtime.Process.DbgManager.Close(res.Where(a => a != null));
         }
         if (dnNodes != null)
         {
             context.Runtime.Process.DbgManager.Close(dnNodes);
         }
         if (!ExceptionUtils.IsInternalDebuggerError(ex))
         {
             throw;
         }
         res = new DbgEngineValueNode[count];
         for (int i = 0; i < res.Length; i++)
         {
             res[i] = owner.CreateError(context, frame, DbgDotNetEngineValueNodeFactoryExtensions.errorName, PredefinedEvaluationErrorMessages.InternalDebuggerError, "<expression>", false, cancellationToken);
         }
         return(res);
     }
     return(res);
 }