/// <summary> /// Sets a stepper for the process. Process will stop with step complete, /// once this stepper completes the step. /// This function just sets the active stepper, but it doesn't continue the process. /// Once the stepper is set, a Go() command needs to be called. /// </summary> /// <returns>A WaitHandle for the Stop event.</returns> public void SetActiveStepper(CorDebug.CorStepper activeStepper) { // we are not interested in finishing old step. if (m_activeStepper != null) m_activeStepper.Deactivate(); m_activeStepper = activeStepper; }
private void StepCompleteEventHandler(Object sender, CorStepCompleteEventArgs e) { OriginalMDbgMessages.WriteLine("ManagedCallback::StepComplete"); if (InternalHandleRawMode(ManagedCallbackType.OnStepComplete, e)) return; // custom stepper handling if (customSteppers != null && customSteppers.Contains(e.Stepper)) { using (var psc = new MDbgProcessStopController(this, e, false)) { var handler = (customSteppers[e.Stepper] as CustomStepperEventHandler); customSteppers.Remove(e.Stepper); handler(this, new CustomStepCompleteEventArgs(psc, e)); } return; // this was custom stepper, no additional action necessary. } // we need to deliver step complete for cordbg skin, so that we can print // enhanced diagnostics. if (HandleCustomPostCallback(ManagedCallbackType.OnStepComplete, e)) return; // we will stop only if this callback is from our own stepper. if (e.Stepper == m_activeStepper) { m_activeStepper = null; e.Continue = false; InternalSignalRuntimeIsStopped(e.Thread, new StepCompleteStopReason(e.Stepper, e.StepReason)); } }