public ImportedModule ImportMscorlib() { if (_mscorlib != null) { return(_mscorlib); } DkmClrAppDomain currentAppDomain = InstructionAddress.ModuleInstance.AppDomain; if (currentAppDomain.IsUnloaded) { return(null); } foreach (DkmClrModuleInstance moduleInstance in currentAppDomain.GetClrModuleInstances()) { if (!moduleInstance.IsUnloaded && moduleInstance.ClrFlags.HasFlag(DkmClrModuleFlags.RuntimeModule)) { _mscorlib = ImportModule(moduleInstance); return(_mscorlib); } } return(null); }
protected ImportedMember(ImportedModule module, StringHandle nameHandle, ImportedType declaringType) { Module = module; DeclaringType = declaringType; _nameHandle = nameHandle; }
public ImportedMethod TryImportCurrentMethod() { if (_currentMethod != null) { return(_currentMethod); } IntPtr metadataBlock; uint blockSize; try { metadataBlock = InstructionAddress.ModuleInstance.GetMetaDataBytesPtr(out blockSize); } catch (DkmException) { // This can fail when dump debugging if the full heap is not available return(null); } ImportedModule module = Session.Importer.ImportModule(metadataBlock, blockSize); _currentMethod = module.GetMethod(InstructionAddress.MethodId.Token); return(_currentMethod); }
private void AddAssembly(ImportedModule module) { MetadataReader mdReader = module.Reader; AssemblyDefinition assemblyDef = mdReader.GetAssemblyDefinition(); string name = mdReader.GetString(assemblyDef.Name); if (!_importedAssemblyNames.Contains(name)) { _importedAssemblyNames.Add(name); } }
public ImportedModule ImportModule(IntPtr metadataPtr, uint blockSize) { ImportedModule module; if (!_modulePtrMap.TryGetValue(metadataPtr, out module)) { module = new ImportedModule(metadataPtr, blockSize); _modulePtrMap.Add(metadataPtr, module); AddAssembly(module); } return(module); }
internal ImportedType(ImportedModule module, TypeDefinition typeDef) : base(module, typeDef.Name, null) { _typeDef = typeDef; }
internal ImportedField(ImportedModule module, FieldDefinition fieldDef, ImportedType declaringType) : base(module, fieldDef.Name, declaringType) { _fieldDef = fieldDef; }
internal ImportedMethod(ImportedModule module, MethodDefinition methodDef, ImportedType declaringType) : base(module, methodDef.Name, declaringType) { _methodDef = methodDef; _signature = methodDef.DecodeSignature(Module.XSharpTypeProvider, genericContext: null); }