private void UnloadClassEventHandler(Object sender, CorClassEventArgs e) { Trace.WriteLine("ManagedCallback::UnloadClass"); BeginManagedDebugEvent(); try { if (InternalHandleRawMode(ManagedCallbackType.OnClassUnload, e)) return; if (HandleCustomPostCallback(ManagedCallbackType.OnClassUnload, e)) return; if (m_engine.Options.StopOnClassLoad) { e.Continue = false; InternalSignalRuntimeIsStopped(null, new ClassUnloadedStopReason()); } } finally { EndManagedDebugEvent(e); } }
private void LoadClassEventHandler(Object sender, CorClassEventArgs e) { CorClass c = e.Class; Trace.WriteLine(string.Format("ManagedCallback::LoadClass:[{0}],0x{1:x}", c.Module.Name, c.Token)); BeginManagedDebugEvent(); try { CorModule corModule = e.Class.Module; if (corModule.IsDynamic) { // We receive LoadClass callbacks always for dynamic modules. // If the module is dynamic, then we have a newly defined class. // In this case we should flush our symbols cache and bind any // breakpoints on this module (which will attempt to eagerly // load symbols if supported) MDbgModule m = m_moduleMgr.Lookup(corModule); Debug.Assert(m != null); m.ReloadSymbols(true); m_breakpointMgr.BindBreakpoints(m); } if (InternalHandleRawMode(ManagedCallbackType.OnClassLoad, e)) return; if (HandleCustomPostCallback(ManagedCallbackType.OnClassLoad, e)) return; if (m_engine.Options.StopOnClassLoad) { e.Continue = false; InternalSignalRuntimeIsStopped(null, new ClassLoadedStopReason(c)); } } finally { EndManagedDebugEvent(e); } }