internal void DispatchEvent(CorModuleLoadEventArgs ev) { if (!options.IsAttaching) { var symreader = ev.Module.GetSymbolReader(); if (symreader != null) { // we will set breakpoint on the user entry code // when debugger creates the debuggee process Int32 token = symreader.UserEntryPoint.GetToken(); if (token != 0) { // FIXME should be better written (control over this breakpoint) CorFunction func = ev.Module.GetFunctionFromToken(token); CorBreakpoint breakpoint = func.CreateBreakpoint(); breakpoint.Activate(true); } } } // we need to save the new module in the modules set modules.Add(ev.Module); ev.Continue = true; if (OnModuleLoad != null) { OnModuleLoad(ev); } }
void ICorDebugManagedCallback.LoadModule(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule) { var ev = new CorModuleLoadEventArgs(new CorAppDomain(pAppDomain, p_options), new CorModule(pModule, p_options)); GetOwner(ev.Controller).DispatchEvent(ev); FinishEvent(ev); }