internal DnAssembly(DnAppDomain appDomain, ICorDebugAssembly assembly, int incrementedId) { this.appDomain = appDomain; this.modules = new DebuggerCollection<ICorDebugModule, DnModule>(CreateModule); this.assembly = new CorAssembly(assembly); this.incrementedId = incrementedId; }
bool OnLoadModule(BreakpointConditionContext context) { var ctx = (DebugEventBreakpointConditionContext)context; var lmArgs = (LoadModuleDebugCallbackEventArgs)ctx.EventArgs; var mod = lmArgs.CorModule; if (!IsOurModule(mod)) return false; debugger.RemoveBreakpoint(breakpoint); breakpoint = null; var serMod = mod.SerializedDnModule; if (type == BreakProcessType.ModuleCctorOrEntryPoint) { uint cctorToken = MetaDataUtils.GetGlobalStaticConstructor(mod.GetMetaDataInterface<IMetaDataImport>()); if (cctorToken != 0) { SetILBreakpoint(serMod, cctorToken); return false; } } string otherModuleName; uint epToken = GetEntryPointToken(filename, out otherModuleName); if (epToken != 0) { if ((Table)(epToken >> 24) == Table.Method) { SetILBreakpoint(serMod, epToken); return false; } if (otherModuleName != null) { Debug.Assert((Table)(epToken >> 24) == Table.File); otherModuleFullName = GetOtherModuleFullName(otherModuleName); if (otherModuleFullName != null) { thisAssembly = mod.Assembly; breakpoint = debugger.CreateBreakpoint(DebugEventBreakpointType.LoadModule, OnLoadOtherModule); return false; } } } // Failed to set BP. Break to debugger. return true; }
internal DnAssembly(DnAppDomain appDomain, ICorDebugAssembly assembly, int uniqueId, int uniqueIdProcess, int uniqueIdAppDomain) { AppDomain = appDomain; modules = new DebuggerCollection<ICorDebugModule, DnModule>(CreateModule); CorAssembly = new CorAssembly(assembly); UniqueId = uniqueId; UniqueIdProcess = uniqueIdProcess; UniqueIdAppDomain = uniqueIdAppDomain; }
/// <summary> /// Create a new instance of the AssemblyLoadedStopReason class. /// </summary> /// <param name="assembly">The assembly that has been loaded.</param> public AssemblyLoadedStopReason(CorAssembly assembly) { Debug.Assert(assembly != null); m_assembly = assembly; }