Example #1
0
 DbgEngineValueNode[] GetChildrenCore(DbgEvaluationInfo evalInfo, ulong index, int count, DbgValueNodeEvaluationOptions options)
 {
     DbgEngineValueNode[]? res     = null;
     DbgDotNetValueNode[]? dnNodes = null;
     try {
         dnNodes = dnValueNode.GetChildren(evalInfo, index, count, options);
         res     = new DbgEngineValueNode[dnNodes.Length];
         for (int i = 0; i < res.Length; i++)
         {
             evalInfo.CancellationToken.ThrowIfCancellationRequested();
             res[i] = owner.Create(dnNodes[i]);
         }
     }
     catch (Exception ex) {
         if (!(res is null))
         {
             evalInfo.Runtime.Process.DbgManager.Close(res.Where(a => !(a is null)));
         }
         if (!(dnNodes is null))
         {
             evalInfo.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(evalInfo, DbgDotNetEngineValueNodeFactoryExtensions.errorName, PredefinedEvaluationErrorMessages.InternalDebuggerError, "<expression>", false);
         }
         return(res);
     }
     return(res);
 }
Example #2
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);
 }
Example #3
0
        public DbgValueNodeImpl(DbgLanguage language, DbgRuntime runtime, DbgEngineValueNode engineValueNode)
        {
            Runtime              = runtime ?? throw new ArgumentNullException(nameof(runtime));
            Language             = language ?? throw new ArgumentNullException(nameof(language));
            this.engineValueNode = engineValueNode ?? throw new ArgumentNullException(nameof(engineValueNode));
            var engineValue = engineValueNode.Value;

            if (!(engineValue is null))
            {
                value = new DbgValueImpl(runtime, engineValue);
            }
Example #4
0
        public DbgValueNodeImpl(DbgLanguage language, DbgRuntime runtime, DbgEngineValueNode engineValueNode)
        {
            Runtime              = runtime ?? throw new ArgumentNullException(nameof(runtime));
            Language             = language ?? throw new ArgumentNullException(nameof(language));
            this.engineValueNode = engineValueNode ?? throw new ArgumentNullException(nameof(engineValueNode));
            var engineValue = engineValueNode.Value;

            if (engineValue is not null)
            {
                value = new DbgValueImpl(runtime, engineValue);
            }
            else if (!engineValueNode.IsReadOnly)
            {
                throw new InvalidOperationException();
            }
        }