示例#1
0
		internal void InitializeAssemblyAndModules() {
			Debugger.DebugVerifyThread();

			// No lock needed, must be called on debugger thread

			var created = new List<DnModule>();
			var modules = this.modules.GetAll();
			for (int i = 0; i < modules.Length; i++) {
				var module = modules[i];
				if (module.CorModuleDef != null) {
					Debug.Assert(corAssemblyDef != null);
					continue;
				}
				module.CorModuleDef = new CorModuleDef(module.CorModule.GetMetaDataInterface<IMetaDataImport>(), new CorModuleDefHelper(module));
				if (corAssemblyDef == null)
					corAssemblyDef = new CorAssemblyDef(module.CorModuleDef, 1);
				corAssemblyDef.Modules.Add(module.CorModuleDef);
				module.CorModuleDef.Initialize();
				created.Add(module);
			}
			Debug.Assert(created.Count != 0);
			foreach (var m in created)
				Debugger.CorModuleDefCreated(m);
		}
示例#2
0
        internal CorAssemblyDef GetOrCreateCorAssemblyDef(DnModule module, CorModuleDef corModuleDef)
        {
            Debugger.DebugVerifyThread();
            if (corAssemblyDef != null)
                return corAssemblyDef;

            // No lock needed, must be called on debugger thread

            Debug.Assert(module.IncrementedId == 0);
            Debug.Assert(module.CorModuleDef == corModuleDef);
            corAssemblyDef = new CorAssemblyDef(corModuleDef, 1);
            return corAssemblyDef;
        }