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); }
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); }