Exemple #1
0
        void IDkmLanguageFrameDecoder.GetFrameName(
            DkmInspectionContext inspectionContext,
            DkmWorkList workList,
            DkmStackWalkFrame frame,
            DkmVariableInfoFlags argumentFlags,
            DkmCompletionRoutine <DkmGetFrameNameAsyncResult> completionRoutine)
        {
            try
            {
                Debug.Assert((argumentFlags & (DkmVariableInfoFlags.Names | DkmVariableInfoFlags.Types | DkmVariableInfoFlags.Values)) == argumentFlags,
                             $"Unexpected argumentFlags '{argumentFlags}'");

                GetNameWithGenericTypeArguments(inspectionContext, workList, frame,
                                                onSuccess: method => GetFrameName(inspectionContext, workList, frame, argumentFlags, completionRoutine, method),
                                                onFailure: e => completionRoutine(DkmGetFrameNameAsyncResult.CreateErrorResult(e)));
            }
            catch (NotImplementedMetadataException)
            {
                inspectionContext.GetFrameName(workList, frame, argumentFlags, completionRoutine);
            }
            catch (Exception e) when(ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e))
            {
                throw ExceptionUtilities.Unreachable;
            }
        }
Exemple #2
0
 /// <summary>
 /// This method is called by the debug engine to get the text representation of a stack
 /// frame.
 /// </summary>
 /// <param name="inspectionContext">Context of the evaluation.  This contains options/flags
 /// to be used during compilation. It also contains the InspectionSession.  The inspection
 /// session is the object that provides lifetime management for our objects.  When the user
 /// steps or continues the process, the debug engine will dispose of the inspection session</param>
 /// <param name="workList">The current work list.  This is used to batch asynchronous
 /// work items.  If any asynchronous calls are needed later, this is the work list to pass
 /// to the asynchronous call.  It's not needed in our case.</param>
 /// <param name="frame">The frame to get the text representation for</param>
 /// <param name="argumentFlags">Option flags to change the way we format frames</param>
 /// <param name="completionRoutine">Completion routine to call when work is completed</param>
 void IDkmLanguageFrameDecoder.GetFrameName(
     DkmInspectionContext inspectionContext,
     DkmWorkList workList,
     DkmStackWalkFrame frame,
     DkmVariableInfoFlags argumentFlags,
     DkmCompletionRoutine <DkmGetFrameNameAsyncResult> completionRoutine)
 {
     try
     {
         string name = TryGetFrameNameHelper(inspectionContext, frame, argumentFlags) ?? "<Unknown Method>";
         completionRoutine(new DkmGetFrameNameAsyncResult(name));
     }
     catch (Exception)
     {
         inspectionContext.GetFrameName(workList, frame, argumentFlags, completionRoutine);
     }
 }