コード例 #1
0
 private DkmSuccessEvaluationResult(
     DkmInspectionContext inspectionContext,
     DkmStackWalkFrame stackFrame,
     string name,
     string fullName,
     DkmEvaluationResultFlags flags,
     string value,
     string editableValue,
     string type,
     DkmEvaluationResultCategory category,
     DkmEvaluationResultAccessType access,
     DkmEvaluationResultStorageType storageType,
     DkmEvaluationResultTypeModifierFlags typeModifierFlags,
     DkmDataAddress address,
     ReadOnlyCollection <DkmCustomUIVisualizerInfo> customUIVisualizers,
     ReadOnlyCollection <DkmModuleInstance> externalModules,
     DkmDataItem dataItem) :
     base(inspectionContext, stackFrame, name, fullName, flags, type, dataItem)
 {
     this.Value               = value;
     this.EditableValue       = editableValue;
     this.Category            = category;
     this.Access              = access;
     this.StorageType         = storageType;
     this.TypeModifierFlags   = typeModifierFlags;
     this.CustomUIVisualizers = customUIVisualizers;
 }
コード例 #2
0
 private DkmSuccessEvaluationResult(
     DkmInspectionContext inspectionContext,
     DkmStackWalkFrame stackFrame,
     string name,
     string fullName,
     DkmEvaluationResultFlags flags,
     string value,
     string editableValue,
     string type,
     DkmEvaluationResultCategory category,
     DkmEvaluationResultAccessType access,
     DkmEvaluationResultStorageType storageType,
     DkmEvaluationResultTypeModifierFlags typeModifierFlags,
     DkmDataAddress address,
     ReadOnlyCollection<DkmCustomUIVisualizerInfo> customUIVisualizers,
     ReadOnlyCollection<DkmModuleInstance> externalModules,
     DkmDataItem dataItem) :
     base(inspectionContext, stackFrame, name, fullName, flags, type, dataItem)
 {
     this.Value = value;
     this.EditableValue = editableValue;
     this.Category = category;
     this.Access = access;
     this.StorageType = storageType;
     this.TypeModifierFlags = typeModifierFlags;
     this.CustomUIVisualizers = customUIVisualizers;
 }
コード例 #3
0
        internal static DkmEvaluationResult GetLuaFunctionChildAtIndex(DkmInspectionContext inspectionContext, DkmStackWalkFrame stackFrame, string fullName, LuaClosureData value, int index)
        {
            var process = stackFrame.Process;

            var processData = DebugHelpers.GetOrCreateDataItem <LuaLocalProcessData>(process);

            if (index == 0)
            {
                if (value == null)
                {
                    return(DkmFailedEvaluationResult.Create(inspectionContext, stackFrame, "[function]", $"{fullName}.!function", "null", DkmEvaluationResultFlags.Invalid, null));
                }

                var functionData = value.ReadFunction(process);

                if (functionData == null)
                {
                    return(DkmFailedEvaluationResult.Create(inspectionContext, stackFrame, "[function]", $"{fullName}.!function", "[internal error: failed to read Proto]", DkmEvaluationResultFlags.Invalid, null));
                }

                string source = functionData.ReadSource(process);

                if (source == null)
                {
                    return(DkmFailedEvaluationResult.Create(inspectionContext, stackFrame, "[function]", $"{fullName}.!function", "[internal error: failed to read source]", DkmEvaluationResultFlags.Invalid, null));
                }

                int line = functionData.definitionStartLine_opt;

                DkmEvaluationResultCategory          category      = DkmEvaluationResultCategory.Method;
                DkmEvaluationResultTypeModifierFlags typeModifiers = DkmEvaluationResultTypeModifierFlags.None;
                DkmEvaluationResultAccessType        access        = DkmEvaluationResultAccessType.Public;
                DkmEvaluationResultStorageType       storage       = DkmEvaluationResultStorageType.Global;

                LuaAddressEntityData entityData = new LuaAddressEntityData
                {
                    source = source,
                    line   = line,

                    functionAddress            = 0,
                    functionInstructionPointer = 0,
                };

                var entityDataBytes = entityData.Encode();

                DkmInstructionAddress instructionAddress = DkmCustomInstructionAddress.Create(processData.runtimeInstance, processData.moduleInstance, entityDataBytes, (ulong)((line << 16) + 0), null, null);

                DkmDataAddress dataAddress = DkmDataAddress.Create(processData.runtimeInstance, value.functionAddress, instructionAddress);

                return(DkmSuccessEvaluationResult.Create(inspectionContext, stackFrame, "[function]", $"{fullName}.!function", DkmEvaluationResultFlags.ReadOnly | DkmEvaluationResultFlags.Address, $"{source}:{line}", null, "Proto*", category, access, storage, typeModifiers, dataAddress, null, null, null));
            }

            Debug.Assert(false, "Invalid child index");

            return(null);
        }
コード例 #4
0
 public ResultProperties(
     DkmClrCompilationResultFlags flags,
     DkmEvaluationResultCategory category,
     DkmEvaluationResultAccessType accessType,
     DkmEvaluationResultStorageType storageType,
     DkmEvaluationResultTypeModifierFlags modifierFlags)
 {
     Flags         = flags;
     Category      = category;
     AccessType    = accessType;
     StorageType   = storageType;
     ModifierFlags = modifierFlags;
 }
コード例 #5
0
ファイル: ResultProperties.cs プロジェクト: Rickinio/roslyn
 public ResultProperties(
     DkmClrCompilationResultFlags flags,
     DkmEvaluationResultCategory category,
     DkmEvaluationResultAccessType accessType,
     DkmEvaluationResultStorageType storageType,
     DkmEvaluationResultTypeModifierFlags modifierFlags)
 {
     this.Flags = flags;
     this.Category = category;
     this.AccessType = accessType;
     this.StorageType = storageType;
     this.ModifierFlags = modifierFlags;
 }
コード例 #6
0
        public static DkmSuccessEvaluationResult Create(DkmInspectionContext InspectionContext, DkmStackWalkFrame StackFrame, string Name, string FullName, DkmEvaluationResultFlags Flags, string Value, string EditableValue, string Type, DkmEvaluationResultCategory Category, DkmEvaluationResultAccessType Access, DkmEvaluationResultStorageType StorageType, DkmEvaluationResultTypeModifierFlags TypeModifierFlags, DkmDataAddress Address, ReadOnlyCollection<DkmCustomUIVisualizerInfo> CustomUIVisualizers, ReadOnlyCollection<DkmModuleInstance> ExternalModules, DkmDataItem DataItem)
        {
            DkmSuccessEvaluationResult result = new DkmSuccessEvaluationResult
            {
                InspectionContext = InspectionContext,
                Name = Name,
                FullName = FullName,
                Flags = Flags,
                Value = Value,
                Type = Type,
                Category = Category,
                EditableValue = EditableValue,
                CustomUIVisualizers = CustomUIVisualizers
            };

            if (DataItem != null)
            {
                result.SetDataItem(DkmDataCreationDisposition.CreateNew, DataItem);
            }

            return result;
        }
コード例 #7
0
 public static DkmSuccessEvaluationResult Create(
     DkmInspectionContext InspectionContext,
     DkmStackWalkFrame StackFrame,
     string Name,
     string FullName,
     DkmEvaluationResultFlags Flags,
     string Value,
     string EditableValue,
     string Type,
     DkmEvaluationResultCategory Category,
     DkmEvaluationResultAccessType Access,
     DkmEvaluationResultStorageType StorageType,
     DkmEvaluationResultTypeModifierFlags TypeModifierFlags,
     DkmDataAddress Address,
     ReadOnlyCollection <DkmCustomUIVisualizerInfo> CustomUIVisualizers,
     ReadOnlyCollection <DkmModuleInstance> ExternalModules,
     DkmDataItem DataItem
     )
 {
     return(new DkmSuccessEvaluationResult(
                InspectionContext,
                StackFrame,
                Name,
                FullName,
                Flags,
                Value,
                EditableValue,
                Type,
                Category,
                Access,
                StorageType,
                TypeModifierFlags,
                Address,
                CustomUIVisualizers,
                ExternalModules,
                DataItem
                ));
 }
コード例 #8
0
 public static DkmSuccessEvaluationResult Create(
     DkmInspectionContext InspectionContext,
     DkmStackWalkFrame StackFrame,
     string Name,
     string FullName,
     DkmEvaluationResultFlags Flags,
     string Value,
     string EditableValue,
     string Type,
     DkmEvaluationResultCategory Category,
     DkmEvaluationResultAccessType Access,
     DkmEvaluationResultStorageType StorageType,
     DkmEvaluationResultTypeModifierFlags TypeModifierFlags,
     DkmDataAddress Address,
     ReadOnlyCollection<DkmCustomUIVisualizerInfo> CustomUIVisualizers,
     ReadOnlyCollection<DkmModuleInstance> ExternalModules,
     DkmDataItem DataItem)
 {
     return new DkmSuccessEvaluationResult(
         InspectionContext,
         StackFrame,
         Name,
         FullName,
         Flags,
         Value,
         EditableValue,
         Type,
         Category,
         Access,
         StorageType,
         TypeModifierFlags,
         Address,
         CustomUIVisualizers,
         ExternalModules,
         DataItem);
 }
コード例 #9
0
        internal static DkmEvaluationResult EvaluateDataAtLuaValue(DkmInspectionContext inspectionContext, DkmStackWalkFrame stackFrame, string name, string fullName, LuaValueDataBase luaValue, DkmEvaluationResultFlags flags, DkmEvaluationResultAccessType access, DkmEvaluationResultStorageType storage)
        {
            var process = stackFrame.Process;

            if (luaValue == null)
            {
                return(DkmFailedEvaluationResult.Create(inspectionContext, stackFrame, name, fullName, "Null pointer access", DkmEvaluationResultFlags.Invalid, null));
            }

            string value = EvaluateValueAtLuaValue(process, luaValue, inspectionContext.Radix, out string editableValue, ref flags, out DkmDataAddress dataAddress, out string type);

            if (value == null)
            {
                return(DkmFailedEvaluationResult.Create(inspectionContext, stackFrame, name, fullName, "Failed to read value", DkmEvaluationResultFlags.Invalid, null));
            }

            DkmEvaluationResultCategory          category      = DkmEvaluationResultCategory.Data;
            DkmEvaluationResultTypeModifierFlags typeModifiers = DkmEvaluationResultTypeModifierFlags.None;

            var dataItem = new LuaEvaluationDataItem
            {
                address      = luaValue.originalAddress,
                type         = type,
                fullName     = fullName,
                luaValueData = luaValue
            };

            return(DkmSuccessEvaluationResult.Create(inspectionContext, stackFrame, name, fullName, flags, value, editableValue, type, category, access, storage, typeModifiers, dataAddress, null, null, dataItem));
        }
コード例 #10
0
        public static DkmSuccessEvaluationResult Create(DkmInspectionContext InspectionContext, DkmStackWalkFrame StackFrame, string Name, string FullName, DkmEvaluationResultFlags Flags, string Value, string EditableValue, string Type, DkmEvaluationResultCategory Category, DkmEvaluationResultAccessType Access, DkmEvaluationResultStorageType StorageType, DkmEvaluationResultTypeModifierFlags TypeModifierFlags, DkmDataAddress Address, ReadOnlyCollection <DkmCustomUIVisualizerInfo> CustomUIVisualizers, ReadOnlyCollection <DkmModuleInstance> ExternalModules, DkmDataItem DataItem)
        {
            DkmSuccessEvaluationResult result = new DkmSuccessEvaluationResult
            {
                InspectionContext = InspectionContext,
                Name                = Name,
                FullName            = FullName,
                Flags               = Flags,
                Value               = Value,
                Type                = Type,
                Category            = Category,
                EditableValue       = EditableValue,
                CustomUIVisualizers = CustomUIVisualizers
            };

            if (DataItem != null)
            {
                result.SetDataItem(DkmDataCreationDisposition.CreateNew, DataItem);
            }

            return(result);
        }