private void NameChangeEventHandler(Object sender, CorThreadEventArgs e) { OriginalMDbgMessages.WriteLine("ManagedCallback::NameChange"); if (InternalHandleRawMode(ManagedCallbackType.OnNameChange, e)) return; }
private void CreateThreadEventHandler(Object sender, CorThreadEventArgs e) { OriginalMDbgMessages.WriteLine("ManagedCallback::CreateThread"); m_threadMgr.Register(e.Thread); if (InternalHandleRawMode(ManagedCallbackType.OnCreateThread, e)) return; if (m_engine.Options.StopOnNewThread) { e.Continue = false; InternalSignalRuntimeIsStopped(e.Thread, new ThreadCreatedStopReason(Threads.GetThreadFromThreadId(e.Thread.Id)) ); return; } if (HandleCustomPostCallback(ManagedCallbackType.OnCreateThread, e)) return; if (m_processAttaching) { // ICorDebug has "fake" debug events on attach. However, it does not have an "AttachComplete" to // let us know when the attach is done and we're now getting "real" debug event. // So MDbg simulates an "attach complete" event, which will come after all the CreateThread events have // been dispatched. If multiple CreateThreads come in a single callback queue, then drain the entire // queue. In other words, don't send the AttachComplete until after the queue has been drained. if (!CorProcess.HasQueuedCallbacks(null)) { if (!m_threadMgr.HaveActive) { m_threadMgr.SetActiveThread(e.Thread); } InternalSignalRuntimeIsStopped(e.Thread, new AttachCompleteStopReason()); e.Continue = false; } } }
private void ExitThreadEventHandler(Object sender, CorThreadEventArgs e) { OriginalMDbgMessages.WriteLine("ManagedCallback::ExitThread"); m_threadMgr.UnRegister(e.Thread); if (InternalHandleRawMode(ManagedCallbackType.OnThreadExit, e)) return; if (HandleCustomPostCallback(ManagedCallbackType.OnThreadExit, e)) return; }
private void BreakEventHandler(Object sender, CorThreadEventArgs e) { OriginalMDbgMessages.WriteLine("ManagedCallback::Break"); if (InternalHandleRawMode(ManagedCallbackType.OnBreak, e)) return; if (HandleCustomPostCallback(ManagedCallbackType.OnBreak, e)) return; e.Continue = false; InternalSignalRuntimeIsStopped(e.Thread, new UserBreakStopReason()); }