Example #1
0
        /** is this a dynamic module? */
        public bool IsDynamic()
        {
            int b = 0;

            m_mod.IsDynamic(out b);
            return(!(b == 0));
        }
        internal static Task <IUnresolvedAssembly> LoadModuleAsync(Module module, ICorDebugModule corModule)
        {
            string name = corModule.GetName();

            if (corModule.IsDynamic() == 1 || corModule.IsInMemory() == 1)
            {
                var defaultUnresolvedAssembly = new DefaultUnresolvedAssembly(name);
                weakTable.Add(defaultUnresolvedAssembly, new ModuleMetadataInfo(module, null));
                return(Task.FromResult <IUnresolvedAssembly>(defaultUnresolvedAssembly));
            }

            //return Task.FromResult(LoadModule(module, name));
            return(Task.Run(() => LoadModule(module, name)));
        }
        internal static Task <IUnresolvedAssembly> LoadModuleAsync(Module module, ICorDebugModule corModule)
        {
            string name = corModule.GetName();

            if (corModule.IsDynamic() == 1 || corModule.IsInMemory() == 1)
            {
                var defaultUnresolvedAssembly       = new DefaultUnresolvedAssembly(name);
                var defaultUnresolvedTypeDefinition = new DefaultUnresolvedTypeDefinition("UnknownDynamicType");
                var defaultUnresolvedMethod         = new DefaultUnresolvedMethod(defaultUnresolvedTypeDefinition, "UnknownMethod");
                var defaultUnresolvedField          = new DefaultUnresolvedField(defaultUnresolvedTypeDefinition, "UnknownField");
                defaultUnresolvedTypeDefinition.Members.Add(defaultUnresolvedMethod);
                defaultUnresolvedTypeDefinition.Members.Add(defaultUnresolvedField);
                defaultUnresolvedAssembly.AddTypeDefinition(defaultUnresolvedTypeDefinition);
                weakTable.Add(defaultUnresolvedAssembly, new ModuleMetadataInfo(module, null));
                return(Task.FromResult <IUnresolvedAssembly>(defaultUnresolvedAssembly));
            }

            //return Task.FromResult(LoadModule(module, name));
            return(Task.Run(() => LoadModule(module, name)));
        }
		internal static Task<IUnresolvedAssembly> LoadModuleAsync(Module module, ICorDebugModule corModule)
		{
			string name = corModule.GetName();
			if (corModule.IsDynamic() == 1 || corModule.IsInMemory() == 1) {
				var defaultUnresolvedAssembly = new DefaultUnresolvedAssembly(name);
				var defaultUnresolvedTypeDefinition = new DefaultUnresolvedTypeDefinition("UnknownDynamicType");
				var defaultUnresolvedMethod = new DefaultUnresolvedMethod(defaultUnresolvedTypeDefinition, "UnknownMethod");
				var defaultUnresolvedField = new DefaultUnresolvedField(defaultUnresolvedTypeDefinition, "UnknownField");
				defaultUnresolvedTypeDefinition.Members.Add(defaultUnresolvedMethod);
				defaultUnresolvedTypeDefinition.Members.Add(defaultUnresolvedField);
				defaultUnresolvedAssembly.AddTypeDefinition(defaultUnresolvedTypeDefinition);
				weakTable.Add(defaultUnresolvedAssembly, new ModuleMetadataInfo(module, null));
				return Task.FromResult<IUnresolvedAssembly>(defaultUnresolvedAssembly);
			}
			
			//return Task.FromResult(LoadModule(module, name));
			return Task.Run(() => LoadModule(module, name));
		}
		internal static Task<IUnresolvedAssembly> LoadModuleAsync(Module module, ICorDebugModule corModule)
		{
			string name = corModule.GetName();
			if (corModule.IsDynamic() == 1 || corModule.IsInMemory() == 1) {
				var defaultUnresolvedAssembly = new DefaultUnresolvedAssembly(name);
				weakTable.Add(defaultUnresolvedAssembly, new ModuleMetadataInfo(module, null));
				return Task.FromResult<IUnresolvedAssembly>(defaultUnresolvedAssembly);
			}
			
			//return Task.FromResult(LoadModule(module, name));
			return Task.Run(() => LoadModule(module, name));
		}