예제 #1
0
파일: Process.cs 프로젝트: pusp/o2platform
 private void NameChangeEventHandler(Object sender, CorThreadEventArgs e)
 {
     OriginalMDbgMessages.WriteLine("ManagedCallback::NameChange");
     if (InternalHandleRawMode(ManagedCallbackType.OnNameChange, e))
         return;
 }
예제 #2
0
파일: Process.cs 프로젝트: pusp/o2platform
        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;
                }
            }
        }
예제 #3
0
파일: Process.cs 프로젝트: pusp/o2platform
        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;
        }
예제 #4
0
파일: Process.cs 프로젝트: pusp/o2platform
        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());
        }