Esempio n. 1
0
        string IDkmLanguageInstructionDecoder.GetMethodName(DkmLanguageInstructionAddress languageInstructionAddress, DkmVariableInfoFlags argumentFlags)
        {
            try
            {
                // DkmVariableInfoFlags.FullNames was accepted by the old GetMethodName implementation,
                // but it was ignored.  Furthermore, it's not clear what FullNames would mean with respect
                // to argument names in C# or Visual Basic.  For consistency with the old behavior, we'll
                // just ignore the flag as well.
                Debug.Assert((argumentFlags & (DkmVariableInfoFlags.FullNames | DkmVariableInfoFlags.Names | DkmVariableInfoFlags.Types)) == argumentFlags,
                             $"Unexpected argumentFlags '{argumentFlags}'");

                var instructionAddress    = (DkmClrInstructionAddress)languageInstructionAddress.Address;
                var compilation           = _instructionDecoder.GetCompilation(instructionAddress.ModuleInstance);
                var method                = _instructionDecoder.GetMethod(compilation, instructionAddress);
                var includeParameterTypes = argumentFlags.Includes(DkmVariableInfoFlags.Types);
                var includeParameterNames = argumentFlags.Includes(DkmVariableInfoFlags.Names);

                return(_instructionDecoder.GetName(method, includeParameterTypes, includeParameterNames));
            }
            catch (NotImplementedMetadataException)
            {
                return(languageInstructionAddress.GetMethodName(argumentFlags));
            }
            catch (Exception e) when(ExpressionEvaluatorFatalError.CrashIfFailFastEnabled(e))
            {
                throw ExceptionUtilities.Unreachable;
            }
        }
Esempio n. 2
0
 string IDkmLanguageInstructionDecoder.GetMethodName(DkmLanguageInstructionAddress languageInstructionAddress, DkmVariableInfoFlags argumentFlags)
 {
     return(_languageInstructionDecoder.GetMethodName(languageInstructionAddress, argumentFlags));
 }