internal DkmEvaluationResult[] GetChildren( DkmEvaluationResult evalResult, int initialRequestSize, DkmInspectionContext inspectionContext, out DkmEvaluationResultEnumContext enumContext ) { DkmGetChildrenAsyncResult getChildrenResult = default(DkmGetChildrenAsyncResult); var workList = new DkmWorkList(); evalResult.GetChildren( workList, initialRequestSize, inspectionContext ?? DefaultInspectionContext, r => { getChildrenResult = r; } ); workList.Execute(); var exception = getChildrenResult.Exception; if (exception != null) { ExceptionDispatchInfo.Capture(exception).Throw(); } enumContext = getChildrenResult.EnumContext; return(getChildrenResult.InitialChildren); }
void IDkmClrResultProvider.GetChildren(DkmEvaluationResult evaluationResult, DkmWorkList workList, int initialRequestSize, DkmInspectionContext inspectionContext, DkmCompletionRoutine <DkmGetChildrenAsyncResult> completionRoutine) { var dataItem = evaluationResult.GetDataItem <EvalResultDataItem>(); if (dataItem == null) { // We don't know about this result. Call next implementation evaluationResult.GetChildren(workList, initialRequestSize, inspectionContext, completionRoutine); return; } completionRoutine(GetChildren(inspectionContext, evaluationResult, dataItem, initialRequestSize)); }
void IDkmClrResultProvider.GetChildren( DkmEvaluationResult evaluationResult, DkmWorkList workList, int initialRequestSize, DkmInspectionContext inspectionContext, DkmCompletionRoutine <DkmGetChildrenAsyncResult> completionRoutine ) { evaluationResult.GetChildren( workList, initialRequestSize, inspectionContext, completionRoutine ); }
void IDkmClrResultProvider.GetChildren(DkmEvaluationResult evaluationResult, DkmWorkList workList, int initialRequestSize, DkmInspectionContext inspectionContext, DkmCompletionRoutine <DkmGetChildrenAsyncResult> completionRoutine) { var dataItem = evaluationResult.GetDataItem <EvalResultDataItem>(); if (dataItem == null) { // We don't know about this result. Call next implementation evaluationResult.GetChildren(workList, initialRequestSize, inspectionContext, completionRoutine); return; } var expansion = dataItem.Expansion; if (expansion == null) { var enumContext = DkmEvaluationResultEnumContext.Create(0, evaluationResult.StackFrame, inspectionContext, new EnumContextDataItem(evaluationResult)); completionRoutine(new DkmGetChildrenAsyncResult(new DkmEvaluationResult[0], enumContext)); return; } // Evaluate children with InspectionContext that is not the root. inspectionContext = inspectionContext.With(NotRoot); var rows = ArrayBuilder <EvalResult> .GetInstance(); int index = 0; expansion.GetRows(this, rows, inspectionContext, dataItem, dataItem.Value, 0, initialRequestSize, visitAll: true, index: ref index); var numRows = rows.Count; Debug.Assert(index >= numRows); Debug.Assert(initialRequestSize >= numRows); var initialChildren = new DkmEvaluationResult[numRows]; CompletionRoutine <Exception> onException = e => completionRoutine(DkmGetChildrenAsyncResult.CreateErrorResult(e)); var wl = new WorkList(workList, onException); wl.ContinueWith(() => GetEvaluationResultsAndContinue(evaluationResult, rows, initialChildren, 0, numRows, wl, inspectionContext, () => wl.ContinueWith( () => { var enumContext = DkmEvaluationResultEnumContext.Create(index, evaluationResult.StackFrame, inspectionContext, new EnumContextDataItem(evaluationResult)); completionRoutine(new DkmGetChildrenAsyncResult(initialChildren, enumContext)); rows.Free(); }), onException)); }
public void GetChildren(DkmEvaluationResult result, DkmWorkList workList, int initialRequestSize, DkmInspectionContext inspectionContext, DkmCompletionRoutine <DkmGetChildrenAsyncResult> completionRoutine) { result.GetChildren(workList, initialRequestSize, inspectionContext, completionRoutine); return; }