Пример #1
0
 void Pause()
 {
     if (process.PauseSession.PausedReason == PausedReason.EvalComplete ||
         process.PauseSession.PausedReason == PausedReason.ExceptionIntercepted)
     {
         process.DisableAllSteppers();
         process.CheckSelectedStackFrames();
         // Do not set selected stack frame
         // Do not raise events
     }
     else
     {
         // Raise the pause event outside the callback
         process.Debugger.MTA2STA.AsyncCall(process.RaisePausedEvents);
     }
 }
Пример #2
0
        void Pause()
        {
            if (process.PauseSession.PausedReason == PausedReason.EvalComplete ||
                process.PauseSession.PausedReason == PausedReason.ExceptionIntercepted)
            {
                // TODO: There might be qued callback after EvalComplete making this unrealiable
                process.DisableAllSteppers();
                process.CheckSelectedStackFrames();
                // Do not set selected stack frame
                // Do not raise events
            }
            else
            {
                // Raise the pause event outside the callback
                // Warning: Make sure that process in not resumed in the meantime
                process.Debugger.MTA2STA.AsyncCall(process.RaisePausedEvents);

                // The event might probably get called out of order when the process is running again
            }
        }